{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "23217e4d",
   "metadata": {},
   "source": [
    "### An introduction to the SMILES ARbitrary Target Specification (SMARTS)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "923e06dc",
   "metadata": {},
   "source": [
    "Install the necessary Python packages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "664ac16c",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.419395Z",
     "start_time": "2025-05-05T16:56:40.417045Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "import sys\n",
    "IN_COLAB = 'google.colab' in sys.modules\n",
    "if IN_COLAB:\n",
    "    !pip install rdkit mols2grid"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a60c5aa",
   "metadata": {},
   "source": [
    "Load the necessary Python packages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4988154b",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.718429Z",
     "start_time": "2025-05-05T16:56:40.576636Z"
    }
   },
   "outputs": [],
   "source": [
    "from rdkit.Chem.Draw import IPythonConsole\n",
    "from rdkit.Chem import rdDepictor\n",
    "from rdkit import Chem\n",
    "\n",
    "IPythonConsole.ipython_useSVG = True\n",
    "IPythonConsole.molSize = 300, 300\n",
    "rdDepictor.SetPreferCoordGen(True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a52221c",
   "metadata": {},
   "source": [
    "### Introduction\n",
    "\n",
    "The **SM**ILES **AR**bitrary **T**arget **S**pecification (SMARTS) is a language for pattern matching in molecules.  SMARTS provides concise means of matching specific substructures in molecules.  Like SMILES, SMARTS was developed and refined by [Dave Weininger](https://en.wikipedia.org/wiki/David_Weininger) and colleagues at Daylight Chemical Information Systems.  \n",
    "\n",
    "The canonical reference for SMARTS is the [Daylight Theory Manual](https://www.daylight.com/dayhtml/doc/theory/), I've borrowed liberally from that here. The [Daylight SMARTS Tutorial](https://www.daylight.com/dayhtml_tutorials/languages/smarts/index.html) is another essential reference. "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fcce1e74",
   "metadata": {},
   "source": [
    "SMARTS share a lot of the same syntax as SMILES but there are a number of critical differences.  At a simple level, any SMILES is also a valid SMARTS.  However, a query with that SMARTS may not give you the answer you want.  This can best be explained via an example.  "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6145f214",
   "metadata": {},
   "source": [
    "In the RDKit, we can parse a SMARTS and create a molecule with pattern matching abilities using the function **Chem.MolFromSmarts**.  If we look at the depicted structure below, we can see that there are aromatic bonds between the ring atoms.  These bond types are implicit since no bonds were specified.  The bond to the methyl carbon is also not specified, so it is of type **single or aromatic**."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "af610d42",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.733769Z",
     "start_time": "2025-05-05T16:56:40.721015Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nO3d61dTV94H8J0QIkECSCISQEEUrCBYbyByEbmdxNrOdKY6be1tWjvtLO20nb9gXsx/oO24sK5ZnSy7Zs10OrpqyQlXsYSKt1qt0gEM90C4BOSSe06eF2cenizso+eQfc7O5fd5NWsaNnsd+WaffZf4/X4EACBHSroCAEQ7CCEAhEEIASAMQggAYRBCAAiDEAJAGIQQAMIghAAQBiEEgDAIIQCEQQgBIAxCCABhEEIACIMQAkAYhBAAwiCEABAGIQSAMAghAIRBCAEgDEIIAGEQQgAIgxACQBiEEADCIIQAEAYhBIAwCCEAhEEIASAMQggAYRBCAAiDEAJAGIQQAMIghAAQBiEEgDAIIQCEQQgBIAxCCABhEEIACIMQAkAYhBAAwiCEABAGIQSAMAghAIRBCAEgTEa6AiBC/PDDD93d3RKJRKfTZWZmkq5OOJH4/X7SdQDhbWFh4e9//7vFYln+fwoKCn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0VJNcUrQaZMoM+xZPc2jEEVNBBDZScgjJVR88qUAfhMOZ+prBEra/XTZqT73n9WHB7d8ESEAAAAAABJRU5ErkJggg==",
      "image/svg+xml": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 108.2,95.6 L 152.5,70.4' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 152.5,70.4 L 196.9,45.2' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 160.1,83.7 L 196.8,62.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 196.9,45.2 L 241.0,71.0' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 241.0,71.0 L 285.0,96.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 233.2,84.2 L 269.6,105.5' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 285.0,96.8 L 284.7,147.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 284.7,147.8 L 284.3,198.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 269.4,147.7 L 269.1,189.9' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 284.3,198.8 L 240.0,224.1' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 240.0,224.1 L 195.6,249.3' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 232.4,210.8 L 195.7,231.7' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 195.6,249.3 L 151.6,223.5' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 151.6,223.5 L 107.5,197.7' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 159.3,210.3 L 122.9,189.0' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 107.5,197.7 L 63.2,223.0' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 61.3,215.2 L 15.0,241.5' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 68.9,228.5 L 22.6,254.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-6 atom-5 atom-0' d='M 107.5,197.7 L 107.9,146.7' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-5 atom-0' d='M 107.9,146.7 L 108.2,95.6' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-5 atom-0' d='M 123.2,146.8 L 123.4,104.6' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path d='M 110.4,94.4 L 108.2,95.6 L 108.2,98.2' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 194.7,46.4 L 196.9,45.2 L 199.1,46.4' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 282.8,95.5 L 285.0,96.8 L 285.0,99.3' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 284.4,196.3 L 284.3,198.8 L 282.1,200.1' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 197.8,248.1 L 195.6,249.3 L 193.4,248.0' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/html": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 108.2,95.6 L 152.5,70.4' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 152.5,70.4 L 196.9,45.2' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 160.1,83.7 L 196.8,62.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 196.9,45.2 L 241.0,71.0' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 241.0,71.0 L 285.0,96.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 233.2,84.2 L 269.6,105.5' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 285.0,96.8 L 284.7,147.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 284.7,147.8 L 284.3,198.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 269.4,147.7 L 269.1,189.9' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 284.3,198.8 L 240.0,224.1' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 240.0,224.1 L 195.6,249.3' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 232.4,210.8 L 195.7,231.7' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 195.6,249.3 L 151.6,223.5' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 151.6,223.5 L 107.5,197.7' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 159.3,210.3 L 122.9,189.0' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 107.5,197.7 L 63.2,223.0' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 61.3,215.2 L 15.0,241.5' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 68.9,228.5 L 22.6,254.8' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path class='bond-6 atom-5 atom-0' d='M 107.5,197.7 L 107.9,146.7' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-5 atom-0' d='M 107.9,146.7 L 108.2,95.6' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-5 atom-0' d='M 123.2,146.8 L 123.4,104.6' style='fill:none;fill-rule:evenodd;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:2,2' />\n",
       "<path d='M 110.4,94.4 L 108.2,95.6 L 108.2,98.2' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 194.7,46.4 L 196.9,45.2 L 199.1,46.4' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 282.8,95.5 L 285.0,96.8 L 285.0,99.3' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 284.4,196.3 L 284.3,198.8 L 282.1,200.1' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 197.8,248.1 L 195.6,249.3 L 193.4,248.0' style='fill:none;stroke:#7F7F7F;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x35de26b90>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "query_mol = Chem.MolFromSmarts(\"c1ccccc1C\")\n",
    "query_mol"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fb660043",
   "metadata": {},
   "source": [
    "Now, let's create a molecule that we'll match.  As a first example, we'll use ethylbenzene. Since this is a molecule, not a query for searching, we'll use **Chem.MolFromSmiles**. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "2f263ff8",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.742978Z",
     "start_time": "2025-05-05T16:56:40.738163Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAABmJLR0QA/wD/AP+gvaeTAAAWZ0lEQVR4nO3dWUyU198H8AMCAuICuKK4ACIIuIFg3UGq1EKTNuGSXjQNSdNm6k0zTdpmbNILmjaWprEJ8YrUK9Q0DlrbjiiIGyC4sQooIIiKgMomIMx78fv3eYfHFmbOPHPOLN/PXRvmzJGZ73P2g5fZbGYAII+37AoAeDqEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEEAyhBBAMoQQQDKEEJzCyZMn9+7dm5aW1tzcLLsuonmZzWbZdQCP1tjYmJ2dXVtbS//p5eX1wQcfHD9+3N/fX27FhEFLCNKMjo5+//338fHxlMCYmJiQkBCz2Xzq1KlVq1aVlpbKrqAgCCHIUVxcHBcX9+WXX05MTCxatKi4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fPorn7BWoFeTInju43AAAAfHpUWHRTTUlMRVMgcmRraXQgMjAyNC4wOS42AAB4nC2MwRGAMAgEW/GpM4Q5SECYPFOKbVi8msjv9vYY45LrO9nuvSjD4jQqYM1U6kVY0nKSQIuXgKv6cqqgUQdbdSxFnLpwg+kS9AcibgT2M9agRRi9v784PdTZRzod9wNXix7Y+bekYwAAAABJRU5ErkJggg==",
      "image/svg+xml": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 150.2,110.7 L 217.9,72.2' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 161.9,117.5 L 217.8,85.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 217.9,72.2 L 285.0,111.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 285.0,111.5 L 284.5,189.3' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 273.3,118.2 L 272.9,182.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 284.5,189.3 L 216.9,227.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 216.9,227.8 L 149.8,188.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 217.0,214.3 L 161.5,181.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 149.8,188.5 L 82.1,226.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 82.1,226.9 L 15.0,187.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7 atom-5 atom-0' d='M 149.8,188.5 L 150.2,110.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 153.6,108.7 L 150.2,110.7 L 150.2,114.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 214.5,74.1 L 217.9,72.2 L 221.2,74.2' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 281.6,109.6 L 285.0,111.5 L 285.0,115.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 284.5,185.4 L 284.5,189.3 L 281.1,191.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 220.3,225.9 L 216.9,227.8 L 213.5,225.8' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 85.5,225.0 L 82.1,226.9 L 78.8,225.0' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/html": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 150.2,110.7 L 217.9,72.2' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 161.9,117.5 L 217.8,85.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 217.9,72.2 L 285.0,111.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 285.0,111.5 L 284.5,189.3' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 273.3,118.2 L 272.9,182.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 284.5,189.3 L 216.9,227.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 216.9,227.8 L 149.8,188.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 217.0,214.3 L 161.5,181.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 149.8,188.5 L 82.1,226.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 82.1,226.9 L 15.0,187.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7 atom-5 atom-0' d='M 149.8,188.5 L 150.2,110.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 153.6,108.7 L 150.2,110.7 L 150.2,114.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 214.5,74.1 L 217.9,72.2 L 221.2,74.2' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 281.6,109.6 L 285.0,111.5 L 285.0,115.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 284.5,185.4 L 284.5,189.3 L 281.1,191.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 220.3,225.9 L 216.9,227.8 L 213.5,225.8' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 85.5,225.0 L 82.1,226.9 L 78.8,225.0' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x35de270d0>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ethyl_benzene = Chem.MolFromSmiles(\"c1ccccc1CC\")\n",
    "ethyl_benzene"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "434963b9",
   "metadata": {},
   "source": [
    "We can now see if our query matches ethyl benzene by using the **HasSubstructMatch** method of the ethyl_benzene molecule object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4c73a348",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.754988Z",
     "start_time": "2025-05-05T16:56:40.753011Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ethyl_benzene.HasSubstructMatch(query_mol)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dd856883",
   "metadata": {},
   "source": [
    "The value **True** above indicates that the ethyl_benzene molecule object does indeed contain the substructure specified by query_mol. We can use the function **GetSubstructMatch** to identify the specific atoms matching a pattern. The code below shows that the pattern specified by query_mol matches atoms 0,1,2,3,4,5 and 6.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a0df7a51",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.768120Z",
     "start_time": "2025-05-05T16:56:40.765869Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 1, 2, 3, 4, 5, 6)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ethyl_benzene.GetSubstructMatch(query_mol)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a3aa920f",
   "metadata": {},
   "source": [
    "One interesting side effect of the call to GetSubstructMatch above is that the depiction shows the selected atoms as highlighted. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "d58f1b2c",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.787210Z",
     "start_time": "2025-05-05T16:56:40.779868Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nO3de1xUdd4H8M9czshdAU0Er6hkaHgJIRVRMBgwrXbXtq3dbGvbntoMtau31MpuljcqbbtvurXb9myvJ6sZQBAveINQrDBQUVAuyv0iAzPMnOePowQGzJzfmZnDwPf9el7P67WPc+ac5ZnPOb/f93c5Cp7nQQiRj1LuCyCkv6MQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqMQEiIzCiEhMqM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AeJwtjMERgDAIBFvxqTOEOUhAmDxTim1YvJrI7/b2GOOS6zvZ7r0ow+I0KmDNVOpFWNJykkCLl4Cr+nKqoFEHW3UsRZy6cIPpEvQHIm4E9jPWoEUYvb+/OD3U2Uc6HfcDV4se2Pm3pGMAAAAASUVORK5CYII=",
      "image/svg+xml": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 201.8,65.2 L 201.6,91.6 L 150.9,120.5 L 128.1,107.1 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-7 atom-0 atom-5' d='M 128.1,107.1 L 150.9,120.5 L 150.5,178.9 L 139.0,185.4 L 127.6,178.7 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 201.8,65.2 L 275.0,108.1 L 252.0,121.1 L 201.6,91.6 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 275.0,108.1 L 274.5,192.9 L 251.6,179.5 L 252.0,121.1 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 251.6,179.5 L 274.5,192.9 L 200.7,234.8 L 200.9,208.4 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 150.5,178.9 L 200.9,208.4 L 200.7,234.8 L 138.9,198.6 L 139.0,185.4 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 127.6,178.7 L 139.0,185.4 L 138.9,198.6 L 82.5,230.8 L 71.1,210.8 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<ellipse cx='139.5' cy='113.8' rx='21.5' ry='21.5' class='atom-0'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='201.7' cy='78.4' rx='21.5' ry='21.5' class='atom-1'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='263.5' cy='114.6' rx='21.5' ry='21.5' class='atom-2'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='263.1' cy='186.2' rx='21.5' ry='21.5' class='atom-3'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='200.8' cy='221.6' rx='21.5' ry='21.5' class='atom-4'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='139.0' cy='185.4' rx='21.5' ry='21.5' class='atom-5'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='76.8' cy='220.8' rx='21.5' ry='21.5' class='atom-6'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 139.5,113.8 L 201.7,78.4' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 150.2,120.1 L 201.7,90.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 201.7,78.4 L 263.5,114.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 263.5,114.6 L 263.1,186.2' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 252.7,120.7 L 252.4,179.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 263.1,186.2 L 200.8,221.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 200.8,221.6 L 139.0,185.4' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 200.9,209.2 L 149.8,179.3' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 139.0,185.4 L 76.8,220.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 76.8,220.8 L 15.0,184.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7 atom-5 atom-0' d='M 139.0,185.4 L 139.5,113.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 142.6,112.0 L 139.5,113.8 L 139.5,117.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 198.6,80.2 L 201.7,78.4 L 204.8,80.2' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 260.4,112.8 L 263.5,114.6 L 263.5,118.2' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 263.1,182.6 L 263.1,186.2 L 259.9,188.0' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 203.9,219.8 L 200.8,221.6 L 197.7,219.8' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 79.9,219.0 L 76.8,220.8 L 73.7,219.0' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/html": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 201.8,65.2 L 201.6,91.6 L 150.9,120.5 L 128.1,107.1 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-7 atom-0 atom-5' d='M 128.1,107.1 L 150.9,120.5 L 150.5,178.9 L 139.0,185.4 L 127.6,178.7 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 201.8,65.2 L 275.0,108.1 L 252.0,121.1 L 201.6,91.6 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 275.0,108.1 L 274.5,192.9 L 251.6,179.5 L 252.0,121.1 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 251.6,179.5 L 274.5,192.9 L 200.7,234.8 L 200.9,208.4 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 150.5,178.9 L 200.9,208.4 L 200.7,234.8 L 138.9,198.6 L 139.0,185.4 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 127.6,178.7 L 139.0,185.4 L 138.9,198.6 L 82.5,230.8 L 71.1,210.8 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<ellipse cx='139.5' cy='113.8' rx='21.5' ry='21.5' class='atom-0'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='201.7' cy='78.4' rx='21.5' ry='21.5' class='atom-1'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='263.5' cy='114.6' rx='21.5' ry='21.5' class='atom-2'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='263.1' cy='186.2' rx='21.5' ry='21.5' class='atom-3'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='200.8' cy='221.6' rx='21.5' ry='21.5' class='atom-4'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='139.0' cy='185.4' rx='21.5' ry='21.5' class='atom-5'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='76.8' cy='220.8' rx='21.5' ry='21.5' class='atom-6'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 139.5,113.8 L 201.7,78.4' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 150.2,120.1 L 201.7,90.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 201.7,78.4 L 263.5,114.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 263.5,114.6 L 263.1,186.2' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 252.7,120.7 L 252.4,179.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 263.1,186.2 L 200.8,221.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 200.8,221.6 L 139.0,185.4' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 200.9,209.2 L 149.8,179.3' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 139.0,185.4 L 76.8,220.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 76.8,220.8 L 15.0,184.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7 atom-5 atom-0' d='M 139.0,185.4 L 139.5,113.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 142.6,112.0 L 139.5,113.8 L 139.5,117.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 198.6,80.2 L 201.7,78.4 L 204.8,80.2' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 260.4,112.8 L 263.5,114.6 L 263.5,118.2' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 263.1,182.6 L 263.1,186.2 L 259.9,188.0' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 203.9,219.8 L 200.8,221.6 L 197.7,219.8' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 79.9,219.0 L 76.8,220.8 L 73.7,219.0' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x35de270d0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ethyl_benzene"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "29ff8e72",
   "metadata": {},
   "source": [
    "### Properties of Atoms\n",
    "\n",
    "So far so good, now let's create another molecule and look at how our pattern matches. This time we'll use biphenyl. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "46fcaaa1",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.796841Z",
     "start_time": "2025-05-05T16:56:40.791511Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAABmJLR0QA/wD/AP+gvaeTAAAbKklEQVR4nO3dW1BT+R0H8H8CRG4iN1FQRBdBvLKgLK5WBWVHZdmH7Wyc2TqxL23ch93sTl/S6XYad7YP2dmd2bgzfcDOTptepjWtthOr0CKKsosiIuIFuXk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tFOtAVCnCOpCtEmeN8ljr54lzrNOtk9N1/lNkbv4AX4WmcqmY50cAAAB6elRYdFNNSUxFUyByZGtpdCAyMDI0LjA5LjYAAHicTYzRDcAgCAVX6acmYICo1XQc1nD4QrW2fL1LjlNW1YAq6idRlY8RkBJRAUkFLtvtBE69N5lUG9CHRGxo4py4tlv4ak8CeZPHcderONhzXZzdNW4zlOFPAsuN4wZNwidRJqmCkgAAAABJRU5ErkJggg==",
      "image/svg+xml": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 196.7,95.9 L 196.5,41.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 188.5,91.2 L 188.5,46.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 196.5,41.9 L 149.7,15.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 149.7,15.0 L 103.0,42.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 149.7,24.4 L 111.1,46.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 103.0,42.1 L 103.1,96.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 103.1,96.1 L 149.9,123.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 111.2,91.4 L 149.9,113.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 149.9,123.0 L 150.1,177.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 150.1,177.0 L 196.9,203.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 150.1,186.4 L 188.8,208.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7 atom-7 atom-8' d='M 196.9,203.9 L 197.0,257.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-8 atom-8 atom-9' d='M 197.0,257.9 L 150.3,285.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-8 atom-8 atom-9' d='M 188.9,253.2 L 150.3,275.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-9 atom-9 atom-10' d='M 150.3,285.0 L 103.5,258.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10 atom-10 atom-11' d='M 103.5,258.1 L 103.3,204.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10 atom-10 atom-11' d='M 111.5,253.4 L 111.5,208.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-11 atom-5 atom-0' d='M 149.9,123.0 L 196.7,95.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-12 atom-11 atom-6' d='M 103.3,204.1 L 150.1,177.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 196.7,93.2 L 196.7,95.9 L 194.3,97.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 196.6,44.6 L 196.5,41.9 L 194.2,40.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 152.1,16.3 L 149.7,15.0 L 147.4,16.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 105.4,40.7 L 103.0,42.1 L 103.0,44.8' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 103.1,93.4 L 103.1,96.1 L 105.5,97.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 194.5,202.6 L 196.9,203.9 L 196.9,206.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 197.0,255.2 L 197.0,257.9 L 194.6,259.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 152.6,283.6 L 150.3,285.0 L 147.9,283.7' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 105.8,259.4 L 103.5,258.1 L 103.4,255.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 103.3,206.8 L 103.3,204.1 L 105.7,202.7' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/html": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-0 atom-0 atom-1' d='M 196.7,95.9 L 196.5,41.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 188.5,91.2 L 188.5,46.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 196.5,41.9 L 149.7,15.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 149.7,15.0 L 103.0,42.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 149.7,24.4 L 111.1,46.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 103.0,42.1 L 103.1,96.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 103.1,96.1 L 149.9,123.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 111.2,91.4 L 149.9,113.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5 atom-5 atom-6' d='M 149.9,123.0 L 150.1,177.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 150.1,177.0 L 196.9,203.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6 atom-6 atom-7' d='M 150.1,186.4 L 188.8,208.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7 atom-7 atom-8' d='M 196.9,203.9 L 197.0,257.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-8 atom-8 atom-9' d='M 197.0,257.9 L 150.3,285.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-8 atom-8 atom-9' d='M 188.9,253.2 L 150.3,275.6' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-9 atom-9 atom-10' d='M 150.3,285.0 L 103.5,258.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10 atom-10 atom-11' d='M 103.5,258.1 L 103.3,204.1' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10 atom-10 atom-11' d='M 111.5,253.4 L 111.5,208.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-11 atom-5 atom-0' d='M 149.9,123.0 L 196.7,95.9' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-12 atom-11 atom-6' d='M 103.3,204.1 L 150.1,177.0' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 196.7,93.2 L 196.7,95.9 L 194.3,97.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 196.6,44.6 L 196.5,41.9 L 194.2,40.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 152.1,16.3 L 149.7,15.0 L 147.4,16.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 105.4,40.7 L 103.0,42.1 L 103.0,44.8' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 103.1,93.4 L 103.1,96.1 L 105.5,97.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 194.5,202.6 L 196.9,203.9 L 196.9,206.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 197.0,255.2 L 197.0,257.9 L 194.6,259.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 152.6,283.6 L 150.3,285.0 L 147.9,283.7' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 105.8,259.4 L 103.5,258.1 L 103.4,255.4' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 103.3,206.8 L 103.3,204.1 L 105.7,202.7' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x35de27920>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "biphenyl = Chem.MolFromSmiles(\"c1ccccc1c2ccccc2\")\n",
    "biphenyl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5fc85ef6",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.805167Z",
     "start_time": "2025-05-05T16:56:40.803240Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "biphenyl.HasSubstructMatch(query_mol)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "91e3e18b",
   "metadata": {},
   "source": [
    "Why didn't the query match?  It's because the query SMARTS c1ccccc1**C** specified a phenyl ring connected to an **aliphatic** carbon.  In biphenyl the corresponding carbon atom is aromatic. In SMARTS, \"C\" only matches aliphatic carbon atoms and \"c\" only matches aromatic carbon atoms.  If we wish to match any carbon we can use \"[#6]\" to specify the atom.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a7d3d82a",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.818443Z",
     "start_time": "2025-05-05T16:56:40.816366Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_query_mol = Chem.MolFromSmarts(\"c1ccccc1[#6]\")\n",
    "biphenyl.HasSubstructMatch(new_query_mol)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ce3d0bb",
   "metadata": {},
   "source": [
    "A similar approach can be applied with other atom types, we can specify any nitrogen atom as [#7] or any oxygen atom as [#8].   "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0219f01a",
   "metadata": {},
   "source": [
    "SMARTS can also be used to query for atoms with a particular charge.  For instance, the SMARTS **[-1]** can be used to identify molecules with a charge of -1.  Note that searching with a SMARTS this way will only identify molecules that were input with a charge of -1.  SMARTS searching does not attempt to determine a molecule's ionization state.  In the example below, we match the SMARTS [-1] against neutral and charged versions of acetic acid. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "7bcc80da",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.831062Z",
     "start_time": "2025-05-05T16:56:40.827158Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" xml:space=\"preserve\" width=\"600px\" height=\"200px\" viewBox=\"0 0 600 200\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"200.0\" height=\"200.0\" x=\"0.0\" y=\"0.0\"> </rect>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 115.4,118.5 L 138.8,104.9\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 138.8,104.9 L 162.2,91.4\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 115.4,106.0 L 133.4,95.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 133.4,95.6 L 156.8,82.1\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-0 atom-2\" d=\"M 115.4,118.5 L 91.9,105.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-0 atom-2\" d=\"M 91.9,105.0 L 68.5,91.5\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 116.5,117.8 L 115.4,118.5 L 114.2,117.8\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path class=\"atom-1\" d=\"M 161.9 77.9 Q 161.9 71.1, 165.2 67.3 Q 168.6 63.5, 174.9 63.5 Q 181.2 63.5, 184.5 67.3 Q 187.9 71.1, 187.9 77.9 Q 187.9 84.8, 184.5 88.7 Q 181.1 92.6, 174.9 92.6 Q 168.6 92.6, 165.2 88.7 Q 161.9 84.8, 161.9 77.9 M 174.9 89.4 Q 179.2 89.4, 181.5 86.5 Q 183.9 83.6, 183.9 77.9 Q 183.9 72.3, 181.5 69.5 Q 179.2 66.7, 174.9 66.7 Q 170.6 66.7, 168.2 69.5 Q 165.9 72.3, 165.9 77.9 Q 165.9 83.6, 168.2 86.5 Q 170.6 89.4, 174.9 89.4 \" fill=\"#FF0000\"/>\n",
       "<path class=\"atom-2\" d=\"M 12.1 68.6 L 16.0 68.6 L 16.0 80.6 L 30.4 80.6 L 30.4 68.6 L 34.3 68.6 L 34.3 96.9 L 30.4 96.9 L 30.4 83.8 L 16.0 83.8 L 16.0 96.9 L 12.1 96.9 L 12.1 68.6 \" fill=\"#FF0000\"/>\n",
       "<path class=\"atom-2\" d=\"M 40.1 82.7 Q 40.1 75.9, 43.4 72.1 Q 46.8 68.3, 53.1 68.3 Q 59.4 68.3, 62.7 72.1 Q 66.1 75.9, 66.1 82.7 Q 66.1 89.6, 62.7 93.5 Q 59.3 97.4, 53.1 97.4 Q 46.8 97.4, 43.4 93.5 Q 40.1 89.6, 40.1 82.7 M 53.1 94.2 Q 57.4 94.2, 59.7 91.3 Q 62.1 88.4, 62.1 82.7 Q 62.1 77.1, 59.7 74.3 Q 57.4 71.5, 53.1 71.5 Q 48.8 71.5, 46.4 74.3 Q 44.1 77.1, 44.1 82.7 Q 44.1 88.4, 46.4 91.3 Q 48.8 94.2, 53.1 94.2 \" fill=\"#FF0000\"/>\n",
       "<path class=\"legend\" d=\"M 82.9 178.5 L 89.7 178.5 L 89.7 179.8 L 84.5 179.8 L 84.5 183.2 L 89.1 183.2 L 89.1 184.5 L 84.5 184.5 L 84.5 189.8 L 82.9 189.8 L 82.9 178.5 \" fill=\"#000000\"/>\n",
       "<path class=\"legend\" d=\"M 90.6 187.6 Q 90.6 186.3, 91.6 185.6 Q 92.7 184.8, 94.6 184.8 L 95.8 184.8 L 95.8 184.5 Q 95.8 183.5, 95.4 183.1 Q 95.0 182.6, 94.0 182.6 Q 93.3 182.6, 92.8 182.8 Q 92.3 182.9, 91.5 183.2 L 91.0 182.2 Q 92.6 181.4, 94.0 181.4 Q 95.8 181.4, 96.6 182.2 Q 97.4 182.9, 97.4 184.5 L 97.4 189.8 L 96.2 189.8 Q 96.2 189.7, 96.1 189.5 Q 96.1 189.2, 96.0 188.8 Q 94.8 190.0, 93.3 190.0 Q 92.1 190.0, 91.3 189.3 Q 90.6 188.7, 90.6 187.6 M 92.1 187.6 Q 92.1 188.2, 92.5 188.5 Q 92.9 188.8, 93.6 188.8 Q 94.2 188.8, 94.8 188.5 Q 95.4 188.2, 95.8 187.7 L 95.8 186.0 L 94.7 186.0 Q 93.4 186.0, 92.7 186.4 Q 92.1 186.8, 92.1 187.6 \" fill=\"#000000\"/>\n",
       "<path class=\"legend\" d=\"M 99.1 177.7 L 100.6 177.7 L 100.6 189.8 L 99.1 189.8 L 99.1 177.7 \" fill=\"#000000\"/>\n",
       "<path class=\"legend\" d=\"M 103.0 188.1 Q 103.7 188.4, 104.2 188.6 Q 104.8 188.7, 105.3 188.7 Q 106.1 188.7, 106.5 188.4 Q 106.9 188.1, 106.9 187.5 Q 106.9 187.1, 106.6 186.9 Q 106.4 186.7, 106.2 186.6 Q 105.9 186.4, 105.2 186.2 Q 105.1 186.2, 104.3 185.9 Q 103.6 185.7, 103.2 185.1 Q 102.8 184.6, 102.8 183.8 Q 102.8 182.8, 103.6 182.1 Q 104.4 181.4, 105.8 181.4 Q 106.5 181.4, 107.0 181.6 Q 107.6 181.7, 108.2 182.0 L 107.8 183.2 Q 107.3 182.9, 106.8 182.8 Q 106.3 182.7, 105.8 182.7 Q 105.1 182.7, 104.7 183.0 Q 104.3 183.3, 104.3 183.8 Q 104.3 184.2, 104.6 184.4 Q 104.9 184.6, 105.6 184.9 Q 105.8 184.9, 105.9 185.0 L 106.3 185.1 Q 107.0 185.4, 107.4 185.6 Q 107.8 185.8, 108.1 186.3 Q 108.4 186.7, 108.4 187.5 Q 108.4 188.7, 107.5 189.3 Q 106.7 190.0, 105.4 190.0 Q 104.6 190.0, 103.9 189.8 Q 103.2 189.6, 102.6 189.3 L 103.0 188.1 \" fill=\"#000000\"/>\n",
       "<path class=\"legend\" d=\"M 109.8 185.7 Q 109.8 183.7, 110.8 182.6 Q 111.8 181.4, 113.6 181.4 Q 115.5 181.4, 116.3 182.5 Q 117.1 183.6, 117.1 185.6 L 117.1 185.9 L 111.3 185.9 Q 111.4 187.3, 112.0 188.0 Q 112.6 188.8, 113.8 188.8 Q 114.4 188.8, 115.0 188.6 Q 115.6 188.4, 116.3 188.1 L 116.7 189.2 Q 115.9 189.6, 115.2 189.8 Q 114.5 189.9, 113.7 189.9 Q 111.8 189.9, 110.8 188.8 Q 109.8 187.7, 109.8 185.7 M 113.6 182.6 Q 112.7 182.6, 112.1 183.2 Q 111.6 183.7, 111.4 184.8 L 115.5 184.8 Q 115.4 183.7, 114.9 183.2 Q 114.5 182.6, 113.6 182.6 \" fill=\"#000000\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 301.4,118.5 L 324.8,104.9\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 324.8,104.9 L 348.2,91.4\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 301.4,106.0 L 319.4,95.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 319.4,95.6 L 342.8,82.1\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-0 atom-2\" d=\"M 301.4,118.5 L 277.9,105.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-0 atom-2\" d=\"M 277.9,105.0 L 254.5,91.5\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 302.6,117.8 L 301.4,118.5 L 300.2,117.8\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path class=\"atom-1\" d=\"M 347.9 77.9 Q 347.9 71.1, 351.3 67.3 Q 354.6 63.5, 360.9 63.5 Q 367.2 63.5, 370.5 67.3 Q 373.9 71.1, 373.9 77.9 Q 373.9 84.8, 370.5 88.7 Q 367.1 92.6, 360.9 92.6 Q 354.7 92.6, 351.3 88.7 Q 347.9 84.8, 347.9 77.9 M 360.9 89.4 Q 365.2 89.4, 367.5 86.5 Q 369.9 83.6, 369.9 77.9 Q 369.9 72.3, 367.5 69.5 Q 365.2 66.7, 360.9 66.7 Q 356.6 66.7, 354.2 69.5 Q 351.9 72.3, 351.9 77.9 Q 351.9 83.6, 354.2 86.5 Q 356.6 89.4, 360.9 89.4 \" fill=\"#FF0000\"/>\n",
       "<path class=\"atom-2\" d=\"M 226.1 82.7 Q 226.1 75.9, 229.5 72.1 Q 232.8 68.3, 239.1 68.3 Q 245.4 68.3, 248.7 72.1 Q 252.1 75.9, 252.1 82.7 Q 252.1 89.6, 248.7 93.5 Q 245.3 97.4, 239.1 97.4 Q 232.9 97.4, 229.5 93.5 Q 226.1 89.6, 226.1 82.7 M 239.1 94.2 Q 243.4 94.2, 245.7 91.3 Q 248.1 88.4, 248.1 82.7 Q 248.1 77.1, 245.7 74.3 Q 243.4 71.5, 239.1 71.5 Q 234.8 71.5, 232.4 74.3 Q 230.1 77.1, 230.1 82.7 Q 230.1 88.4, 232.4 91.3 Q 234.8 94.2, 239.1 94.2 \" fill=\"#FF0000\"/>\n",
       "<path class=\"atom-2\" d=\"M 256.1 72.9 L 265.8 72.9 L 265.8 75.0 L 256.1 75.0 L 256.1 72.9 \" fill=\"#FF0000\"/>\n",
       "<path class=\"legend\" d=\"M 288.0 179.8 L 284.5 179.8 L 284.5 178.5 L 292.9 178.5 L 292.9 179.8 L 289.6 179.8 L 289.6 189.9 L 288.0 189.9 L 288.0 179.8 \" fill=\"#000000\"/>\n",
       "<path class=\"legend\" d=\"M 294.8 181.6 L 295.0 182.8 Q 295.8 181.5, 297.2 181.5 Q 297.7 181.5, 298.3 181.6 L 298.0 183.0 Q 297.4 182.8, 297.0 182.8 Q 296.3 182.8, 295.9 183.1 Q 295.4 183.4, 295.1 184.0 L 295.1 189.9 L 293.6 189.9 L 293.6 181.6 L 294.8 181.6 \" fill=\"#000000\"/>\n",
       "<path class=\"legend\" d=\"M 306.2 181.6 L 306.2 189.9 L 305.0 189.9 L 304.8 188.7 Q 303.7 190.0, 302.0 190.0 Q 300.6 190.0, 299.9 189.3 Q 299.2 188.5, 299.2 187.1 L 299.2 181.6 L 300.7 181.6 L 300.7 187.0 Q 300.7 187.9, 301.1 188.4 Q 301.5 188.8, 302.3 188.8 Q 303.0 188.8, 303.7 188.5 Q 304.3 188.1, 304.7 187.5 L 304.7 181.6 L 306.2 181.6 \" fill=\"#000000\"/>\n",
       "<path class=\"legend\" d=\"M 308.2 185.7 Q 308.2 183.7, 309.2 182.6 Q 310.2 181.5, 312.0 181.5 Q 313.9 181.5, 314.7 182.6 Q 315.5 183.6, 315.5 185.7 L 315.5 185.9 L 309.7 185.9 Q 309.8 187.3, 310.4 188.1 Q 311.0 188.8, 312.2 188.8 Q 312.8 188.8, 313.4 188.7 Q 314.0 188.5, 314.7 188.2 L 315.2 189.2 Q 314.3 189.6, 313.6 189.8 Q 312.9 190.0, 312.1 190.0 Q 310.2 190.0, 309.2 188.9 Q 308.2 187.7, 308.2 185.7 M 312.0 182.7 Q 311.1 182.7, 310.5 183.2 Q 310.0 183.8, 309.8 184.8 L 313.9 184.8 Q 313.8 183.7, 313.3 183.2 Q 312.9 182.7, 312.0 182.7 \" fill=\"#000000\"/>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# An list of SMILES with acetic acid and acetate anion\n",
    "smiles_list = [\"C(=O)O\",\"C(=O)[O-]\"]\n",
    "# Convert SMILES to RDKit molecules\n",
    "mol_list = [Chem.MolFromSmiles(x) for x in smiles_list]\n",
    "# Create a query molecule from SMARTS\n",
    "anion_query = Chem.MolFromSmarts(\"[-1]\")\n",
    "# Match the query to the molecules, convert the output to string so that MolsToGrid can display as a legend\n",
    "match_list = [str(x.HasSubstructMatch(anion_query)) for x in mol_list]\n",
    "# Draw the structures\n",
    "Chem.Draw.MolsToGridImage(mol_list,legends=match_list)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "da8cbbb5",
   "metadata": {},
   "source": [
    "### Queries With Atom Lists\n",
    "\n",
    "In many cases, we want to be able to create a query that will match multiple atom types.  For instance, we may want to create a query that will match both benzene and pyridine.  We can do this by specifying a comma-separated list of atom types in square brackets.  We can specify a query that will match benzene and pyridine with the SMARTS **c1cccc[c,n]1**."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "bc00f66e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.845286Z",
     "start_time": "2025-05-05T16:56:40.842808Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[True, True]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "smiles_list = [\"c1ccccc1\",\"c1ccccn1\"]\n",
    "mol_list = [Chem.MolFromSmiles(x) for x in smiles_list]\n",
    "query_mol = Chem.MolFromSmarts(\"c1cccc[c,n]1\")\n",
    "[x.HasSubstructMatch(query_mol) for x in mol_list]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "249260f7",
   "metadata": {},
   "source": [
    "Note that we could also rewrite the query we used above to match aromatic and aliphatic carbon atoms as **c1cccc[c,C]1**."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "54ada13b",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.853896Z",
     "start_time": "2025-05-05T16:56:40.851595Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[True, True]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "smiles_list = [\"c1ccccc1C\",\"c1ccccc1c2ccccc2\" ]\n",
    "mol_list = [Chem.MolFromSmiles(x) for x in smiles_list]\n",
    "query_mol = Chem.MolFromSmarts(\"c1cccc[c,C]1\")\n",
    "[x.HasSubstructMatch(query_mol) for x in mol_list]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2b93f186",
   "metadata": {},
   "source": [
    "Atom lists can also include atom specifiers such as [#8].  We can construct a query that matches any nitrogen or oxygen attached to an aliphatic carbon as **C[#7,#8]**.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "8697d33c",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.871560Z",
     "start_time": "2025-05-05T16:56:40.865312Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAABmJLR0QA/wD/AP+gvaeTAAAZTUlEQVR4nO3deVxU9f7H8c8MDLIooqImYCHKoikqInrRNJYSjG6Pex9Wt6ug17qtFqNpau4m5pYMmPbI/GkuPbql99ev0KRkk3BJEgQ3IEVRkUVQWYZ1mPP7Y4QmBnQOzPAZ4P38a6LhzDnlyznnfL/nHIkgCAQAfKTcKwDQ3SFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCFCAGaIEIAZIgRghggBmCF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WqNHQNdIzNDM10tE10DMysTDSsdY11DOytLDQAfJNDYFcAz0TY2OovKWZjjWUD+NCVetClUNNgxqmWQMAZDUVH93KbJwAAAAASUVORK5CYII=",
      "image/svg+xml": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-2 atom-2 atom-3' d='M 172.0,126.0 L 182.0,143.2 L 128.0,174.4 L 118.0,157.1 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<ellipse cx='123.0' cy='165.7' rx='18.7' ry='18.7' class='atom-2'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='177.0' cy='134.8' rx='18.7' ry='19.2' class='atom-3'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 15.0,165.6 L 69.0,134.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 69.0,134.5 L 123.0,165.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 123.0,165.7 L 162.8,142.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 191.2,142.8 L 231.0,165.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 231.0,165.8 L 285.0,134.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 66.3,136.1 L 69.0,134.5 L 71.7,136.1' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 120.3,164.2 L 123.0,165.7 L 125.0,164.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 229.0,164.7 L 231.0,165.8 L 233.7,164.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='atom-3' d='M 164.9 134.7\n",
       "Q 164.9 128.3, 168.0 124.8\n",
       "Q 171.1 121.2, 177.0 121.2\n",
       "Q 182.9 121.2, 186.0 124.8\n",
       "Q 189.2 128.3, 189.2 134.7\n",
       "Q 189.2 141.1, 186.0 144.8\n",
       "Q 182.8 148.4, 177.0 148.4\n",
       "Q 171.2 148.4, 168.0 144.8\n",
       "Q 164.9 141.1, 164.9 134.7\n",
       "M 177.0 145.4\n",
       "Q 181.1 145.4, 183.2 142.7\n",
       "Q 185.4 140.0, 185.4 134.7\n",
       "Q 185.4 129.5, 183.2 126.9\n",
       "Q 181.1 124.2, 177.0 124.2\n",
       "Q 173.0 124.2, 170.8 126.8\n",
       "Q 168.6 129.4, 168.6 134.7\n",
       "Q 168.6 140.0, 170.8 142.7\n",
       "Q 173.0 145.4, 177.0 145.4\n",
       "' fill='#000000'/>\n",
       "</svg>\n"
      ],
      "text/html": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='300px' height='300px' viewBox='0 0 300 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='300.0' height='300.0' x='0.0' y='0.0'> </rect>\n",
       "<path class='bond-2 atom-2 atom-3' d='M 172.0,126.0 L 182.0,143.2 L 128.0,174.4 L 118.0,157.1 Z' style='fill:#FF7F7F;fill-rule:evenodd;fill-opacity:1;stroke:#FF7F7F;stroke-width:0.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<ellipse cx='123.0' cy='165.7' rx='18.7' ry='18.7' class='atom-2'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<ellipse cx='177.0' cy='134.8' rx='18.7' ry='19.2' class='atom-3'  style='fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0 atom-0 atom-1' d='M 15.0,165.6 L 69.0,134.5' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1 atom-1 atom-2' d='M 69.0,134.5 L 123.0,165.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2 atom-2 atom-3' d='M 123.0,165.7 L 162.8,142.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3 atom-3 atom-4' d='M 191.2,142.8 L 231.0,165.8' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4 atom-4 atom-5' d='M 231.0,165.8 L 285.0,134.7' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path d='M 66.3,136.1 L 69.0,134.5 L 71.7,136.1' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 120.3,164.2 L 123.0,165.7 L 125.0,164.6' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path d='M 229.0,164.7 L 231.0,165.8 L 233.7,164.3' style='fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;' />\n",
       "<path class='atom-3' d='M 164.9 134.7\n",
       "Q 164.9 128.3, 168.0 124.8\n",
       "Q 171.1 121.2, 177.0 121.2\n",
       "Q 182.9 121.2, 186.0 124.8\n",
       "Q 189.2 128.3, 189.2 134.7\n",
       "Q 189.2 141.1, 186.0 144.8\n",
       "Q 182.8 148.4, 177.0 148.4\n",
       "Q 171.2 148.4, 168.0 144.8\n",
       "Q 164.9 141.1, 164.9 134.7\n",
       "M 177.0 145.4\n",
       "Q 181.1 145.4, 183.2 142.7\n",
       "Q 185.4 140.0, 185.4 134.7\n",
       "Q 185.4 129.5, 183.2 126.9\n",
       "Q 181.1 124.2, 177.0 124.2\n",
       "Q 173.0 124.2, 170.8 126.8\n",
       "Q 168.6 129.4, 168.6 134.7\n",
       "Q 168.6 140.0, 170.8 142.7\n",
       "Q 173.0 145.4, 177.0 145.4\n",
       "' fill='#000000'/>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x35de88890>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mol = Chem.MolFromSmiles(\"CCCOCC\")\n",
    "query_mol = Chem.MolFromSmarts(\"C[#7,#8]\")\n",
    "mol.GetSubstructMatch(query_mol)\n",
    "mol"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2e52732d",
   "metadata": {},
   "source": [
    "### SMARTS Specifying the Number of Attachments to an Atom\n",
    "\n",
    "There are two ways of writing queries that specify the number of attachments to an atom.  Valence, which is specified with \"v\" and degree which is specified with \"D\".  I'm the first to admit that I still confuse these and usually need to write a couple of examples to remember how this works.  In order to do test the two types of queries, let's define a few molecules. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "19cae570",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.882005Z",
     "start_time": "2025-05-05T16:56:40.878640Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" xml:space=\"preserve\" width=\"600px\" height=\"400px\" viewBox=\"0 0 600 400\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"200.0\" height=\"200.0\" x=\"0.0\" y=\"0.0\"> </rect>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 10.0,112.9 L 55.0,87.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 55.0,87.0 L 100.0,113.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 100.0,113.0 L 145.0,87.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 145.0,87.0 L 190.0,113.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 52.8,88.3 L 55.0,87.0 L 57.3,88.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 97.8,111.7 L 100.0,113.0 L 102.3,111.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 142.8,88.3 L 145.0,87.0 L 147.3,88.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 367.5,138.9 L 322.5,113.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 322.5,113.0 L 322.4,61.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-1 atom-3\" d=\"M 322.5,113.0 L 277.5,139.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 277.5,139.0 L 232.5,113.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 279.8,137.7 L 277.5,139.0 L 275.3,137.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 474.2,64.4 L 500.1,109.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 500.1,109.5 L 526.2,64.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-1 atom-3\" d=\"M 500.1,109.5 L 455.0,135.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-1 atom-4\" d=\"M 500.1,109.5 L 545.0,135.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 167.5,290.4 L 122.5,316.4\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 163.6,283.6 L 122.5,307.4\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 122.5,316.4 L 77.5,290.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 77.5,290.3 L 32.5,316.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 124.7,315.1 L 122.5,316.4 L 120.2,315.1\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 79.8,291.6 L 77.5,290.3 L 75.3,291.6\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 255.0,326.0 L 255.0,274.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 262.8,321.5 L 262.8,278.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 255.0,274.0 L 300.0,248.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 300.0,248.0 L 345.0,274.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 300.0,257.0 L 337.2,278.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 345.0,274.0 L 345.0,326.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4 atom-4 atom-5\" d=\"M 345.0,326.0 L 300.0,352.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4 atom-4 atom-5\" d=\"M 337.2,321.5 L 300.0,343.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5 atom-5 atom-0\" d=\"M 300.0,352.0 L 255.0,326.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 255.0,323.4 L 255.0,326.0 L 257.2,327.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 255.0,276.6 L 255.0,274.0 L 257.3,272.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 297.8,249.3 L 300.0,248.0 L 302.3,249.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 342.8,272.7 L 345.0,274.0 L 345.0,276.6\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 345.0,323.4 L 345.0,326.0 L 342.7,327.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 302.2,350.7 L 300.0,352.0 L 297.7,350.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "smiles_list = [\"CCCCC\",\"CC(C)CC\",\"CC(C)(C)C\",\"C=CCC\",\"c1ccccc1\"]\n",
    "mol_list = [Chem.MolFromSmiles(x) for x in smiles_list]\n",
    "Chem.Draw.MolsToGridImage(mol_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "ae1e7e9b",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.894406Z",
     "start_time": "2025-05-05T16:56:40.890730Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" xml:space=\"preserve\" width=\"600px\" height=\"400px\" viewBox=\"0 0 600 400\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"200.0\" height=\"200.0\" x=\"0.0\" y=\"0.0\"> </rect>\n",
       "<ellipse cx=\"55.0\" cy=\"94.8\" rx=\"15.6\" ry=\"15.6\" class=\"atom-1\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 10.0,120.7 L 55.0,94.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 55.0,94.8 L 100.0,120.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 100.0,120.8 L 145.0,94.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 145.0,94.8 L 190.0,120.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 52.8,96.0 L 55.0,94.8 L 57.3,96.1\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 97.8,119.5 L 100.0,120.8 L 102.3,119.5\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 142.8,96.1 L 145.0,94.8 L 147.3,96.1\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<ellipse cx=\"277.5\" cy=\"131.2\" rx=\"15.6\" ry=\"15.6\" class=\"atom-3\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 367.5,131.1 L 322.5,105.2\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 322.5,105.2 L 322.4,53.2\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-1 atom-3\" d=\"M 322.5,105.2 L 277.5,131.2\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 277.5,131.2 L 232.5,105.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 279.8,129.9 L 277.5,131.2 L 275.3,129.9\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 474.2,64.4 L 500.1,109.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 500.1,109.5 L 526.2,64.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-1 atom-3\" d=\"M 500.1,109.5 L 455.0,135.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-1 atom-4\" d=\"M 500.1,109.5 L 545.0,135.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"122.5\" cy=\"308.6\" rx=\"15.6\" ry=\"15.6\" class=\"atom-1\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 167.5,282.6 L 122.5,308.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 163.6,275.9 L 122.5,299.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 122.5,308.6 L 77.5,282.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 77.5,282.5 L 32.5,308.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 124.7,307.3 L 122.5,308.6 L 120.2,307.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 79.8,283.8 L 77.5,282.5 L 75.3,283.8\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<ellipse cx=\"262.8\" cy=\"326.0\" rx=\"15.6\" ry=\"15.6\" class=\"atom-0\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 262.8,326.0 L 262.8,274.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 270.6,321.5 L 270.6,278.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 262.8,274.0 L 307.8,248.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 307.8,248.0 L 352.8,274.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 307.8,257.0 L 345.0,278.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 352.8,274.0 L 352.8,326.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4 atom-4 atom-5\" d=\"M 352.8,326.0 L 307.8,352.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4 atom-4 atom-5\" d=\"M 345.0,321.5 L 307.8,343.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5 atom-5 atom-0\" d=\"M 307.8,352.0 L 262.8,326.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 262.8,323.4 L 262.8,326.0 L 265.0,327.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 262.8,276.6 L 262.8,274.0 L 265.1,272.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 305.6,249.3 L 307.8,248.0 L 310.1,249.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 350.6,272.7 L 352.8,274.0 L 352.8,276.6\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 352.8,323.4 L 352.8,326.0 L 350.5,327.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 310.0,350.7 L 307.8,352.0 L 305.5,350.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "query_smarts = \"[D2]\"\n",
    "query_mol = Chem.MolFromSmarts(query_smarts)\n",
    "match_list = []\n",
    "for mol in mol_list:\n",
    "    match_list.append(mol.GetSubstructMatch(query_mol))\n",
    "Chem.Draw.MolsToGridImage(mol_list,highlightAtomLists=match_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "398b99cc",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.902492Z",
     "start_time": "2025-05-05T16:56:40.900345Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((1,), (2,), (3,))"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mol_list[0].GetSubstructMatches(query_mol)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "d319deea",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.913017Z",
     "start_time": "2025-05-05T16:56:40.909809Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" xml:space=\"preserve\" width=\"600px\" height=\"400px\" viewBox=\"0 0 600 400\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"200.0\" height=\"200.0\" x=\"0.0\" y=\"0.0\"> </rect>\n",
       "<ellipse cx=\"55.0\" cy=\"94.8\" rx=\"15.6\" ry=\"15.6\" class=\"atom-1\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 10.0,120.7 L 55.0,94.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 55.0,94.8 L 100.0,120.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 100.0,120.8 L 145.0,94.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 145.0,94.8 L 190.0,120.8\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 52.8,96.0 L 55.0,94.8 L 57.3,96.1\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 97.8,119.5 L 100.0,120.8 L 102.3,119.5\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 142.8,96.1 L 145.0,94.8 L 147.3,96.1\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<ellipse cx=\"277.5\" cy=\"131.2\" rx=\"15.6\" ry=\"15.6\" class=\"atom-3\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 367.5,131.1 L 322.5,105.2\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 322.5,105.2 L 322.4,53.2\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-1 atom-3\" d=\"M 322.5,105.2 L 277.5,131.2\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 277.5,131.2 L 232.5,105.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 279.8,129.9 L 277.5,131.2 L 275.3,129.9\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 474.2,64.4 L 500.1,109.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 500.1,109.5 L 526.2,64.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-1 atom-3\" d=\"M 500.1,109.5 L 455.0,135.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-1 atom-4\" d=\"M 500.1,109.5 L 545.0,135.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"122.5\" cy=\"308.6\" rx=\"15.6\" ry=\"15.6\" class=\"atom-1\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 167.5,282.6 L 122.5,308.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 163.6,275.9 L 122.5,299.6\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 122.5,308.6 L 77.5,282.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 77.5,282.5 L 32.5,308.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 124.7,307.3 L 122.5,308.6 L 120.2,307.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 79.8,283.8 L 77.5,282.5 L 75.3,283.8\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<ellipse cx=\"262.8\" cy=\"326.0\" rx=\"15.6\" ry=\"15.6\" class=\"atom-0\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 262.8,326.0 L 262.8,274.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0 atom-0 atom-1\" d=\"M 270.6,321.5 L 270.6,278.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1 atom-1 atom-2\" d=\"M 262.8,274.0 L 307.8,248.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 307.8,248.0 L 352.8,274.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2 atom-2 atom-3\" d=\"M 307.8,257.0 L 345.0,278.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3 atom-3 atom-4\" d=\"M 352.8,274.0 L 352.8,326.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4 atom-4 atom-5\" d=\"M 352.8,326.0 L 307.8,352.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4 atom-4 atom-5\" d=\"M 345.0,321.5 L 307.8,343.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5 atom-5 atom-0\" d=\"M 307.8,352.0 L 262.8,326.0\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 262.8,323.4 L 262.8,326.0 L 265.0,327.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 262.8,276.6 L 262.8,274.0 L 265.1,272.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 305.6,249.3 L 307.8,248.0 L 310.1,249.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 350.6,272.7 L 352.8,274.0 L 352.8,276.6\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 352.8,323.4 L 352.8,326.0 L 350.5,327.3\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "<path d=\"M 310.0,350.7 L 307.8,352.0 L 305.5,350.7\" style=\"fill:none;stroke:#000000;stroke-width:2.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;\"/>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Chem.Draw.MolsToGridImage(mol_list,highlightAtomLists=match_list)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "383c7ba5",
   "metadata": {},
   "source": [
    "In this section, we'll use the amazing mols2grid component to interactively practice our SMARTS searching skills.  mols2grid provides the ability to create a paginated table of chemical structures.  We can also use this table to select structures and programmatically grab the selected structures.  In addition, mols2grid provides the ability to interactively search the table using SMARTS. A SMARTS search in mols2grid does two things.\n",
    "- Filters the table so that only molecules matching the SMARTS are shown\n",
    "- Highlights the atoms matching the SMARTS\n",
    "\n",
    "In order to search the mols2grid table using SMARTS, we need to do the following: \n",
    "- Click on the magnifying glass in the lower right corner\n",
    "- Select SMARTS\n",
    "\n",
    "<img src=\"https://raw.githubusercontent.com/PatWalters/practical_cheminformatics_tutorials/main/images/smarts_tutorial_using_mols2grid.png\" />"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c57447e4",
   "metadata": {},
   "source": [
    "In the code block below, we create a grid with the five molecules in mol_list.  Try this out with a few queries.\n",
    "- aliphatic carbon - C\n",
    "- aromatic carbon - c\n",
    "- vinyl group C=C\n",
    "- trisubstituted carbon [#6D3]\n",
    "- carbon with three attached bonds [#6X3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "d18facb6",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:40.964699Z",
     "start_time": "2025-05-05T16:56:40.920931Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5b59339e8e404f1b91cef571001f7de6",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "MolGridWidget()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<style>\n",
       "    /* Some CSS to integrate with Jupyter more cleanly */\n",
       "    div.output_subarea {\n",
       "        /* Undo an unfortunate max-width parameter\n",
       "        that causes the output area to be too narrow\n",
       "        on smaller screens. */\n",
       "        max-width: none;\n",
       "\n",
       "        /* Align the table with the content */\n",
       "        padding: 0;\n",
       "\n",
       "        /* Let it breathe */\n",
       "        margin-top: 20px;\n",
       "    }\n",
       "</style>\n",
       "\n",
       "<iframe class=\"mols2grid-iframe\" frameborder=\"0\" width=\"100%\"\n",
       "    \n",
       "    \n",
       "    allow=\"clipboard-write\"\n",
       "    \n",
       "    \n",
       "    sandbox=\"allow-scripts allow-same-origin allow-downloads allow-popups allow-modals\"\n",
       "    \n",
       "    srcdoc=\"\n",
       "\n",
       "\n",
       "\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;UTF-8&quot; /&gt;\n",
       "        &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt;\n",
       "        &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;\n",
       "        &lt;title&gt;Document!&lt;/title&gt;\n",
       "\n",
       "\n",
       "\n",
       "        &lt;style&gt;\n",
       "            /**\n",
       " * General styling\n",
       " */\n",
       "body {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "}\n",
       "h1,h2,h3,h4 {\n",
       "    margin: 0 0 10px 0;\n",
       "}\n",
       "h1 {\n",
       "    font-size: 26px;\n",
       "}\n",
       "h2 {\n",
       "    font-size: 20px;\n",
       "    font-weight: 400;\n",
       "}\n",
       "h3 {\n",
       "\tfont-size: 16px;\n",
       "}\n",
       "p {\n",
       "    margin: 0 0 10px 0;\n",
       "}\n",
       "\n",
       "\n",
       "/* Remove body margin inside iframe */\n",
       "body.m2g-inside-iframe {\n",
       "    margin: 0;\n",
       "}\n",
       "\n",
       "/* In-cell text */\n",
       "#mols2grid .data:not(.data-img) {\n",
       "    height: 16px;\n",
       "    line-height: 16px;\n",
       "}\n",
       "/* Text truncation */\n",
       "#mols2grid .data {\n",
       "    /* Break text into multiple lines (default for static)... */\n",
       "    word-wrap: normal;\n",
       "\n",
       "    /* ...or truncate it (default for interactive). */\n",
       "    overflow: hidden;\n",
       "    white-space: nowrap;\n",
       "    text-overflow: ellipsis;\n",
       "}\n",
       "\n",
       "\n",
       "/**\n",
       " * Popover\n",
       " * - - -\n",
       " * Note: this is a bootstrap variable which is not namespaced.\n",
       " * To avoid any contamination, we only style it when the\n",
       " * x-placement parameter is set.\n",
       " */\n",
       ".popover[x-placement] {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    background: white;\n",
       "    border: solid 1px rgba(0,0,0,.2);\n",
       "    font-size: 12px;\n",
       "    padding: 10px;\n",
       "    border-radius: 5px;\n",
       "    box-shadow: 0 0 20px rgba(0,0,0,.15);\n",
       "    user-select: none;\n",
       "}\n",
       ".popover[x-placement] h3 {\n",
       "    margin: 0;\n",
       "}\n",
       ".popover[x-placement] .arrow {\n",
       "    width: 10px;\n",
       "    height: 10px;\n",
       "    background: #fff;\n",
       "    border: solid 1px rgba(0,0,0,.2);\n",
       "    box-sizing: border-box;\n",
       "    position: absolute;\n",
       "    transform-origin: 5px 5px;\n",
       "    clip-path: polygon(0 0, 100% 0, 100% 100%);\n",
       "}\n",
       ".popover[x-placement=&#x27;left&#x27;] .arrow {\n",
       "    transform: rotate(45deg);\n",
       "    top: 50%;\n",
       "    right: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;right&#x27;] .arrow {\n",
       "    transform: rotate(-135deg);\n",
       "    top: 50%;\n",
       "    left: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;top&#x27;] .arrow {\n",
       "    transform: rotate(135deg);\n",
       "    left: 50%;\n",
       "    bottom: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;bottom&#x27;] .arrow {\n",
       "    transform: rotate(-45deg);\n",
       "    left: 50%;\n",
       "    top: -5px;\n",
       "}\n",
       "            body {\n",
       "    /* Colors */\n",
       "    --m2g-black: rgba(0,0,0,.75);\n",
       "    --m2g-black-soft: rgba(0,0,0,.35);\n",
       "    --m2g-black-10: rgba(0,0,0,.1);\n",
       "    --m2g-bg: #f6f6f6;\n",
       "    --m2g-border: solid 1px rgba(0,0,0,0.2);\n",
       "    --m2g-hl: #555; /* Highlight color */\n",
       "    --m2g-hl-shadow: inset 0 0 0 1px var(--m2g-hl); /* Inset 1px shadow to make border thicker */\n",
       "    --m2g-blue: #0f62fe;\n",
       "    --m2g-blue-soft: rgba(15,98,254,.2);\n",
       "\n",
       "    /* Icons */\n",
       "    --m2g-icn-triangle: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;20&quot; fill=&quot;rgba(0,0,0,.75)&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M9.5713 13.285L6.2543 7.757C6.0543 7.424 6.2953 7 6.6823 7L13.3173 7C13.7053 7 13.9463 7.424 13.7453 7.757L10.4283 13.285C10.2343 13.609 9.7653 13.609 9.5713 13.285Z&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    --m2g-icn-triangle-white: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;20&quot; fill=&quot;white&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M9.5713 13.285L6.2543 7.757C6.0543 7.424 6.2953 7 6.6823 7L13.3173 7C13.7053 7 13.9463 7.424 13.7453 7.757L10.4283 13.285C10.2343 13.609 9.7653 13.609 9.5713 13.285Z&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    --m2g-icn-cb-white: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 16 16&quot; fill=&quot;none&quot; stroke=&quot;white&quot; stroke-width=&quot;2.5&quot; stroke-linecap=&quot;round&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M4 7.65686L7 10.6569L12.6569 5.00001&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    \n",
       "    /* Border radius */\n",
       "    --m2g-br: 3px;\n",
       "    --m2g-br-l: var(--m2g-br) 0 0 var(--m2g-br); /* Left-only */\n",
       "    --m2g-br-r: 0 var(--m2g-br) var(--m2g-br) 0; /* Right-only */\n",
       "\n",
       "    /* Text */\n",
       "    --m2g-fs: 14px; /* UI font-size */\n",
       "    --m2g-fs-cell: 12px; /* Cell font-size */\n",
       "\n",
       "    /* Transition speeds */\n",
       "    --m2g-trans: 150ms;\n",
       "\n",
       "    /* Layout */\n",
       "    --m2g-h: 40px; /* Form element height */\n",
       "}\n",
       "\n",
       "/* Styling */\n",
       "#mols2grid {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    font-size: var(--m2g-fs);\n",
       "}\n",
       "\n",
       "/* Fixes */\n",
       "#mols2grid *,\n",
       "#mols2grid *::before,\n",
       "#mols2grid *::after {\n",
       "    box-sizing: border-box;\n",
       "    outline: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Functions section\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-functions {\n",
       "    display: flex;\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-row {\n",
       "    flex: 0;\n",
       "    display: flex;\n",
       "}\n",
       "\n",
       "/* Individual elements don&#x27;t scale */\n",
       "#mols2grid .m2g-functions .m2g-row &gt; * {\n",
       "    flex: 0 0;\n",
       "    margin-right: 10px;\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-row:last-child &gt; *:last-child {\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "/* Row 1: pagination + gap + sort */\n",
       "#mols2grid .m2g-functions .m2g-row:first-child {\n",
       "    flex: 1; /* Scale */\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-gap {\n",
       "    /* The gap in between will scale, so the pagination\n",
       "    stays on the left, while the rest moves to the right */\n",
       "    flex: 1;\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Pagination\n",
       " */\n",
       "\n",
       "#mols2grid ul.m2g-pagination {\n",
       "    /* Unset defaults */\n",
       "    list-style-type: none;\n",
       "    margin-block-start: 0;\n",
       "    margin-block-end: 0;\n",
       "    margin-inline-start: 0;\n",
       "    margin-inline-end: 0;\n",
       "    padding-inline-start: 0;\n",
       "\n",
       "    /* Custom */\n",
       "    display: flex;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li {\n",
       "    background: var(--m2g-bg) ;\n",
       "    border: var(--m2g-border);\n",
       "    height: var(--m2g-h);\n",
       "    min-width: calc(var(--m2g-h) + 1px);\n",
       "    position: relative;\n",
       "    user-select: none;\n",
       "    \n",
       "    /* Compensate for double border */\n",
       "    margin-right: -1px;\n",
       "    \n",
       "    /* Center text */\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li:last-child {\n",
       "    min-width: var(--m2g-h);\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li a {\n",
       "    text-decoration: none;\n",
       "    color: var(--m2g-black);\n",
       "    padding: 0 10px;\n",
       "    width: 100%;\n",
       "    height: var(--m2g-h);\n",
       "    line-height: var(--m2g-h);\n",
       "    text-align: center;\n",
       "    /* Compensate for border so there&#x27;s no gap between click areas  */\n",
       "    margin: 0 -1px;\n",
       "}\n",
       "\n",
       "/* Corner shape */\n",
       "#mols2grid ul.m2g-pagination li:first-child {\n",
       "    border-radius: var(--m2g-br-l);\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li:last-child {\n",
       "    border-radius: var(--m2g-br-r);\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid ul.m2g-pagination li:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "    z-index: 1;\n",
       "}\n",
       "\n",
       "/* Active state */\n",
       "#mols2grid ul.m2g-pagination li.active {\n",
       "    background: var(--m2g-hl);\n",
       "    z-index: 1;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li.active a {\n",
       "    cursor: default;\n",
       "    color: #fff;\n",
       "}\n",
       "\n",
       "/* Disabled sate */\n",
       "#mols2grid ul.m2g-pagination li.disabled a {\n",
       "    cursor: default;\n",
       "    color: rgba(0,0,0,.25);\n",
       "    pointer-events: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Dropdowns\n",
       " */\n",
       "\n",
       "#mols2grid ::placeholder {\n",
       "    color: var(--m2g-black-soft);\n",
       "}\n",
       "#mols2grid .m2g-dropdown {\n",
       "    height: var(--m2g-h);\n",
       "    background: var(--m2g-bg);\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: var(--m2g-br);\n",
       "    position: relative;\n",
       "}\n",
       "#mols2grid .m2g-dropdown select {\n",
       "    -webkit-appearance: none;\n",
       "    -moz-appearance: none;\n",
       "    -ms-appearance: none;\n",
       "    appearance: none;\n",
       "    background: transparent;\n",
       "    border: none;\n",
       "    height: 100%;\n",
       "    padding: 0 13px;\n",
       "    min-width: 0;\n",
       "    max-width: 250px;\n",
       "    color: var(--m2g-black);\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       "/* Icon */\n",
       "#mols2grid .m2g-dropdown .m2g-icon {\n",
       "    width: 30px;\n",
       "    height: var(--m2g-h);\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "    position: absolute;\n",
       "    top: 0;\n",
       "    right: 0;\n",
       "    pointer-events: none;\n",
       "}\n",
       "#mols2grid .m2g-dropdown .m2g-icon svg:not(.m2g-stroke) {\n",
       "    fill: var(--m2g-black);\n",
       "}\n",
       "#mols2grid .m2g-dropdown .m2g-icon svg.m2g-stroke {\n",
       "    stroke: var(--m2g-black);\n",
       "}\n",
       "\n",
       "/* Display */\n",
       "/* We hide the native select element because\n",
       " * it is limited in styling. Instead, we display\n",
       " * the selected value in a div. */\n",
       "#mols2grid .m2g-dropdown .m2g-display {\n",
       "    position: absolute;\n",
       "    left: 0;\n",
       "    right: 0;\n",
       "    top: 0;\n",
       "    bottom: 0;\n",
       "    pointer-events: none;\n",
       "    color: var(--m2g-black);\n",
       "    line-height: var(--m2g-h);\n",
       "    padding: 0 25px 0 13px;\n",
       "\n",
       "    /* Truncate dropdown text */\n",
       "    white-space: nowrap;\n",
       "\ttext-overflow: ellipsis;\n",
       "\toverflow: hidden;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-dropdown:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Action dropdown\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-dropdown.m2g-actions {\n",
       "    width: var(--m2g-h);\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-actions select {\n",
       "    opacity: 0;\n",
       "    width: var(--m2g-h);\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-actions .m2g-icon {\n",
       "    width: var(--m2g-h);\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Sort dropdown\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-dropdown.m2g-sort {\n",
       "    flex: 0 0 200px;\n",
       "    width: 200px; /* Needed in addition to flex-basis for small sizes! */\n",
       "    border-radius: var(--m2g-br);\n",
       "    background: var(--m2g-bg);\n",
       "    display: flex;\n",
       "}\n",
       "\n",
       "/* Dropdown */\n",
       "#mols2grid .m2g-dropdown.m2g-sort select {\n",
       "    flex: 1 1;\n",
       "    opacity: 0;\n",
       "    /* padding-right: 70px; Space for &quot;Sort:&quot; */\n",
       "    box-sizing: border-box;\n",
       "}\n",
       "\n",
       "/* Sort order */\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-order {\n",
       "    background: var(--m2g-bg) var(--m2g-icn-triangle) no-repeat center;\n",
       "    flex: 0 0 30px;\n",
       "    height: 100%;\n",
       "    border-left: var(--m2g-border);\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-sort.m2d-arrow-desc .m2g-order {\n",
       "    transform: rotate(180deg);\n",
       "    border-left: none;\n",
       "    border-right: var(--m2g-border);\n",
       "}\n",
       "\n",
       "/* Display */\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-display {\n",
       "    right: 31px;\n",
       "    padding-right: 13px;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-display::before {\n",
       "    content: &#x27;Sort: &#x27;;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-dropdown.m2g-sort:focus-within .m2g-display,\n",
       "#mols2grid .m2g-dropdown.m2g-sort:focus-within .m2g-order {\n",
       "    background-color: transparent;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Search bar\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-search-wrap {\n",
       "    height: var(--m2g-h);\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: flex-end;\n",
       "    background: var(--m2g-bg);\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: var(--m2g-br);\n",
       "}\n",
       "#mols2grid .m2g-searchbar {\n",
       "    width: 170px;\n",
       "    height: var(--m2g-h);\n",
       "    padding: 0 13px;\n",
       "    border: none;\n",
       "    color: var(--m2g-black);\n",
       "    cursor: text;\n",
       "    background: transparent;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-search-wrap:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "/* Option buttons */\n",
       "#mols2grid .m2g-search-options {\n",
       "    font-size: 12px;\n",
       "    display: flex;\n",
       "    height: calc(1.5em + .75rem);\n",
       "    line-height: calc(1.5em + .75rem);\n",
       "    margin-right: 5px;\n",
       "    border-radius: var(--m2g-br);\n",
       "    color: var(--m2g-black);\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option {\n",
       "    background: var(--m2g-black-10);\n",
       "    padding: 0 13px;\n",
       "    cursor: default;\n",
       "    user-select: none;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:not(.sel) {\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:first-child {\n",
       "    border-radius: 2px 0 0 2px;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:last-child {\n",
       "    border-radius: 0 2px 2px 0;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option.sel {\n",
       "    background: var(--m2g-hl);\n",
       "    color: #fff;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Grid\n",
       " */\n",
       "\n",
       "/* Container */\n",
       "#mols2grid .m2g-list {\n",
       "    display: flex;\n",
       "    flex-wrap: wrap;\n",
       "    align-items: flex-start;\n",
       "    justify-content: flex-start;\n",
       "    padding: 1px; /* Compensate for negative padding on cell */\n",
       "    user-select: none;\n",
       "    margin: 0px;\n",
       "    margin-top: 20px;\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    \n",
       "}\n",
       "\n",
       "/* Cell */\n",
       "#mols2grid .m2g-cell {\n",
       "    border: 1px solid #cccccc;\n",
       "    text-align: center;\n",
       "    vertical-align: top;\n",
       "    font-family: var(--font-family);\n",
       "    padding: 10px;\n",
       "    padding-top: max(10px, 20px);\n",
       "    margin: -1px -1px 0 0;\n",
       "    flex: 1 0 130px;\n",
       "    position: relative;\n",
       "    font-size: var(--m2g-fs-cell);\n",
       "    cursor: pointer;\n",
       "    color: var(--m2g-black);\n",
       "    overflow: hidden;\n",
       "    box-sizing: border-box;\n",
       "    background-color: white;\n",
       "}\n",
       "#mols2grid .m2g-cell:focus {\n",
       "    z-index: 1;\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "/* Phantom cells to maintain grid structure with less results */\n",
       "#mols2grid .m2g-cell.m2g-phantom {\n",
       "    border: none;\n",
       "    pointer-events: none;\n",
       "    height: 0;\n",
       "    padding: 0;\n",
       "}\n",
       "\n",
       "/* Checkbox &amp; ID */\n",
       "#mols2grid .m2g-cb-wrap {\n",
       "    position: absolute;\n",
       "    top: 3px;\n",
       "    left: 3px;\n",
       "    display: flex;\n",
       "    border-radius: 2px;\n",
       "    font-size: 0;\n",
       "    line-height: 0;\n",
       "    padding: 3px;\n",
       "    padding-right: 0;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] {\n",
       "    display: none;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] + .m2g-cb {\n",
       "\twidth: 16px;\n",
       "\theight: 16px;\n",
       "\tbox-sizing: border-box;\n",
       "\tbackground: #fff;\n",
       "\tborder: var(--m2g-border);\n",
       "\tborder-radius: 2px;\n",
       "    margin-right: 5px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox]:checked + .m2g-cb {\n",
       "    border: none;\n",
       "    background-color: var(--m2g-blue);\n",
       "    background-image: var(--m2g-icn-cb-white);\n",
       "}\n",
       "#mols2grid .m2g-tooltip {\n",
       "    /* This is a div spanning full cell size where the\n",
       "    tooltip is rendered around, because you can&#x27;t attach\n",
       "    it to the parent due to list.js limitation. */\n",
       "    width: 100%;\n",
       "    height: 100%;\n",
       "    position: absolute;\n",
       "    left: 0;\n",
       "    top: 0;\n",
       "    z-index: -1;\n",
       "    pointer-events: none;\n",
       "    opacity: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell:has(:checked) {\n",
       "    background: #ffd !important; /* Overrides user-set background color */\n",
       "}\n",
       "#mols2grid .data-mols2grid-id-display {\n",
       "    font-size: var(--m2g-fs-cell);\n",
       "    line-height: 16px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] + .data-mols2grid-id-display {\n",
       "    padding: 0 5px 0 5px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap .data-name-display {\n",
       "    font-size: var(--m2g-fs);\n",
       "    line-height: 16px;\n",
       "}\n",
       "\n",
       "/* Info + callback button wrap (28px high) */\n",
       "#mols2grid .m2g-cell-actions {\n",
       "    position: absolute;\n",
       "    top: 0;\n",
       "    right: 0;\n",
       "    display: flex;\n",
       "    flex-direction: row;\n",
       "    font-size: 0;\n",
       "    line-height: 0;\n",
       "    \n",
       "    /* background: yellow; */\n",
       "}\n",
       "\n",
       "/* Info button */\n",
       "#mols2grid .m2g-info {\n",
       "    width: 28px;\n",
       "    height: 28px;\n",
       "    border-radius: 2px;\n",
       "    line-height: 28px;\n",
       "    font-size: min(14px, 12px);\n",
       "    font-family: Georgia, serif;\n",
       "    font-style: italic;\n",
       "    padding: 0;\n",
       "    text-align: center;\n",
       "}\n",
       "#mols2grid .m2g-keep-tooltip .m2g-info {\n",
       "    color: #fff;\n",
       "}\n",
       "#mols2grid .m2g-keep-tooltip .m2g-info::before {\n",
       "    content: &#x27;i&#x27;;\n",
       "    width: 18px;\n",
       "    height: 18px;\n",
       "    line-height: 18px;\n",
       "    background: var(--m2g-hl);\n",
       "    position: absolute;\n",
       "    left: 5px;\n",
       "    top: 5px;\n",
       "    border-radius: 9px;\n",
       "}\n",
       "\n",
       "/* Callback button */\n",
       "#mols2grid .m2g-callback {\n",
       "    width: 28px;\n",
       "    height: 28px;\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-callback::after {\n",
       "    content: &#x27;&#x27;;\n",
       "    display: block;\n",
       "    width: 16px;\n",
       "    height: 16px;\n",
       "    margin: 6px;\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: 2px;\n",
       "    background: var(--m2g-bg) var(--m2g-icn-triangle) no-repeat center;\n",
       "    transform: rotate(-90deg);\n",
       "}\n",
       "\n",
       "/* Image */\n",
       "#mols2grid .m2g-cell .data-img {\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell img,\n",
       "#mols2grid .m2g-cell svg {\n",
       "    max-width: 100%;\n",
       "    height: auto;\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell svg &gt; rect:first-child {\n",
       "    /* Remove the SVG background */\n",
       "    fill: transparent !important;\n",
       "}\n",
       "\n",
       "/* Text below image */\n",
       ".m2g-copy-blink {\n",
       "    animation: m2g-blink var(--m2g-trans) 3;\n",
       "}\n",
       "@keyframes m2g-blink {\n",
       "    0% {\n",
       "        opacity: 1;\n",
       "    }\n",
       "    49% {\n",
       "        opacity: 1;\n",
       "    }\n",
       "    50% {\n",
       "        opacity: 0;\n",
       "    }\n",
       "    100% {\n",
       "        opacity: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* Copyable text */\n",
       ".copy-me {\n",
       "    position: relative;\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Modal popup\n",
       " * - - -\n",
       " * Triggered by make_popup_callback()\n",
       " * See https://mols2grid.readthedocs.io/en/latest/notebooks/callbacks.html#Display-a-popup-containing-descriptors\n",
       " */\n",
       "\n",
       "/* Container */\n",
       "#m2g-modal-container {\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "    background: var(--m2g-black-10);\n",
       "    position: fixed;\n",
       "    top: 0;\n",
       "    left: 0;\n",
       "    z-index: 1;\n",
       "    width: 100%;\n",
       "    height: 100%;\n",
       "    \n",
       "    /* Transition */\n",
       "    opacity: 0;\n",
       "    transition: opacity var(--m2g-trans) linear;\n",
       "}\n",
       "\n",
       "/* Modal */\n",
       "#m2g-modal {\n",
       "    background: #fff;\n",
       "    border-radius: var(--m2g-br);\n",
       "    box-shadow: 0 0 30px var(--m2g-black-10);\n",
       "    padding: 20px;\n",
       "    position: relative;\n",
       "    max-width: calc(100% - 80px);\n",
       "    max-height: calc(100% - 80px);\n",
       "    display: flex;\n",
       "    flex-direction: column;\n",
       "    min-width: 26px;\n",
       "\n",
       "    /* Transition */\n",
       "    opacity: 0;\n",
       "    transform: translate(0, 5px);\n",
       "    transition: transform var(--m2g-trans) ease-in-out, opacity var(--m2g-trans) linear;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header {\n",
       "    flex: 0 0 26px;\n",
       "    margin-bottom: 10px;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header h2 {\n",
       "    margin-bottom: 0;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header h2 + p {\n",
       "    font-size: 15px;\n",
       "}\n",
       "#m2g-modal .m2g-modal-body {\n",
       "    flex: 1;\n",
       "    position: relative;\n",
       "}\n",
       "\n",
       "/* Transition */\n",
       "#m2g-modal-container.show {\n",
       "    opacity: 1;\n",
       "}\n",
       "#m2g-modal-container.show #m2g-modal {\n",
       "    opacity: 1;\n",
       "    transform: translate(0, 0);\n",
       "}\n",
       "\n",
       "/* Header + close btn */\n",
       "#m2g-modal h2 {\n",
       "    line-height: 26px;\n",
       "    padding-right: 40px;\n",
       "    text-transform: capitalize;\n",
       "}\n",
       "#m2g-modal h3 {\n",
       "    \n",
       "}\n",
       "#m2g-modal button.close {\n",
       "    background: transparent;\n",
       "    padding: 0;\n",
       "    color: var(--m2g-black);\n",
       "    font-size: 1.5rem;\n",
       "    width: 40px;\n",
       "    height: 40px;\n",
       "    position: absolute;\n",
       "    top: 13px;\n",
       "    right: 13px;\n",
       "    border: none;\n",
       "}\n",
       "\n",
       "/* Image */\n",
       "#m2g-modal .svg-wrap svg {\n",
       "    max-width: 100%;\n",
       "    margin-bottom: 20px;\n",
       "}\n",
       "\n",
       "/* Separator */\n",
       "hr {\n",
       "    width: 100%;\n",
       "    height: 1px;\n",
       "    background: #ddd;\n",
       "    margin: 15px 0;\n",
       "    border: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Hover states\n",
       " */\n",
       "@media (hover:hover) {\n",
       "    /* Pagination */\n",
       "    #mols2grid ul.m2g-pagination li:not(.active):not(.disabled):hover {\n",
       "        background: #f0f0f0;\n",
       "        z-index: 1;\n",
       "    }\n",
       "    #mols2grid ul.m2g-pagination li.active + li:hover {\n",
       "        /* Keeping the hover border consiistent */\n",
       "        margin-left: 1px;\n",
       "        border-left: none;\n",
       "        min-width: 40px;\n",
       "    }\n",
       "\n",
       "    /* Dropdowns &amp; search */\n",
       "    #mols2grid .m2g-dropdown:not(:focus-within):hover,\n",
       "    #mols2grid .m2g-search-wrap:not(:focus-within):hover,\n",
       "    #mols2grid .m2g-sort:not(:focus-within) .m2g-order:hover {\n",
       "        background-color: #f0f0f0;\n",
       "    }\n",
       "    #mols2grid .m2g-search-wrap:not(:focus-within):hover {\n",
       "        background: #fff;\n",
       "        border-color: rgba(0,0,0,.3);\n",
       "    }\n",
       "    /* Hocus pocus to have separate hover states for dropdown and arrow */\n",
       "    #mols2grid .m2g-dropdown.m2g-sort:not(:focus-within):hover .m2g-order:not(:hover) + .m2g-display {\n",
       "        background-color: transparent;\n",
       "    }\n",
       "\n",
       "    /* Search options */\n",
       "    #mols2grid .m2g-search-options .m2g-option:not(.sel):hover {\n",
       "        background: rgba(0,0,0,.15);\n",
       "    }\n",
       "\n",
       "    /* Grid */\n",
       "    /* Note: this is in an ::after pseudo element, so the transparent\n",
       "    hover color plays nice with the cell background color. */\n",
       "    #mols2grid .m2g-cell:hover::after {\n",
       "        content: &#x27;&#x27;;\n",
       "        width: 100%;\n",
       "        height: 100%;\n",
       "        position: absolute;\n",
       "        top: 0;\n",
       "        left: 0;\n",
       "        background-color: rgba(0,0,0,0.05);\n",
       "        pointer-events: none;\n",
       "    }\n",
       "\n",
       "    /* info button */\n",
       "    #mols2grid .m2g-info:hover::before {\n",
       "        content: &#x27;i&#x27;;\n",
       "        color: #fff;\n",
       "        width: 18px;\n",
       "        height: 18px;\n",
       "        line-height: 18px;\n",
       "        background: var(--m2g-hl);\n",
       "        position: absolute;\n",
       "        left: 5px;\n",
       "        top: 5px;\n",
       "        border-radius: 9px;\n",
       "    }\n",
       "    \n",
       "    /* Callback button */\n",
       "    #mols2grid .m2g-callback:hover::after {\n",
       "        background-color: var(--m2g-black);\n",
       "        background-image: var(--m2g-icn-triangle-white);\n",
       "        border-color: transparent;\n",
       "    }\n",
       "\n",
       "    /* Copyable text */\n",
       "    .copy-me:hover {\n",
       "        text-decoration: underline;\n",
       "        text-decoration-color: var(--m2g-blue);\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Responsive behavior.\n",
       " * - - -\n",
       " * Note: container queries won&#x27;t work in older browsers,\n",
       " * but this is purely aesthetical behavior so that&#x27;s ok.\n",
       " * https://caniuse.com/css-container-queries\n",
       " */\n",
       "\n",
       "/* This sets the msg-list div as reference container */\n",
       "#mols2grid {\n",
       "    container-type: inline-size;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Functions section\n",
       " */\n",
       "\n",
       "/* When there&#x27;s not enough space to put everything in one row, we break it into two.\n",
       " * - - -\n",
       " * 870px = pagination 280 + sort 200 + search 300 + menu 40 + (3*10 gap) = 850 + 20 buffer.\n",
       " * Buffer required because the button width inside the search depends on the font.\n",
       " */\n",
       "@container (max-width: 870px) {\n",
       "    #mols2grid .m2g-functions {\n",
       "        flex-direction: column-reverse;\n",
       "        gap: 10px;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-row:last-child {\n",
       "        justify-content: flex-end;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-row:first-child *:last-child {\n",
       "        margin-right: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for pagination + sort on one row,\n",
       " * we reduce the sort drodpwon width.\n",
       " */\n",
       "@container (max-width: 500px) {\n",
       "    #mols2grid .m2g-functions .m2g-sort {\n",
       "        width: 80px;\n",
       "        flex-basis: 80px;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-sort .m2g-display {\n",
       "        font-size: 0;\n",
       "        line-height: 0;\n",
       "        padding-right: 0;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-sort .m2g-display::before {\n",
       "        content: &#x27;Sort&#x27;;\n",
       "        font-size: var(--m2g-fs);\n",
       "        line-height: var(--m2g-h);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for pagination + reduced sort on one row,\n",
       " * we reduce the pagination width.\n",
       " */\n",
       "@container (max-width: 500px) {\n",
       "    /* We&#x27;re overriding min-width from different\n",
       "    locations, including responsive rules */\n",
       "    #mols2grid ul.m2g-pagination li,\n",
       "    #mols2grid ul.m2g-pagination li:last-child,\n",
       "    #mols2grid ul.m2g-pagination li.active + li:hover {\n",
       "        min-width: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for searchbar + menu\n",
       " * we scale down the searchbar to fit the container.\n",
       " */\n",
       "@container (max-width: 370px) {\n",
       "    #mols2grid .m2g-functions .m2g-row .m2g-search-wrap {\n",
       "        flex: 1;\n",
       "    }\n",
       "    #mols2grid .m2g-searchbar {\n",
       "        width: calc(100% - 50px);\n",
       "    }\n",
       "    #mols2grid .m2g-search-options {\n",
       "        width: 50px;\n",
       "    }\n",
       "\n",
       "    /* Collapse options in T/M buttons */\n",
       "    #mols2grid .m2g-search-options .m2g-option {\n",
       "        width: 25px;\n",
       "        text-align: center;\n",
       "        padding: 0;\n",
       "        overflow: hidden;\n",
       "    }\n",
       "    #mols2grid .m2g-search-options .m2g-option:first-child::before {\n",
       "        content: &#x27;T\\A&#x27;\n",
       "    }\n",
       "    #mols2grid .m2g-search-options .m2g-option:last-child::before {\n",
       "        content: &#x27;S\\A&#x27;\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Grid\n",
       " */\n",
       "\n",
       "/* When there&#x27;s room for 5 columns, fall back to 4 */\n",
       "@container (min-width: 519px) and (max-width: 779px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 4);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s room for 7-11 columns, fall back to 6 */\n",
       "@container (min-width: 779px) and (max-width: 1559px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 6);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s room for 13+ columns, fall back to 12 */\n",
       "@container (min-width: 1559px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 12);\n",
       "    }\n",
       "}\n",
       "\n",
       "            /* Custom CSS */\n",
       "            \n",
       "        &lt;/style&gt;\n",
       "        &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js&quot;&gt;&lt;/script&gt;\n",
       "&lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot; integrity=&quot;sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;\n",
       "&lt;script src=&quot;https://unpkg.com/@rdkit/rdkit@2022.3.1/Code/MinimalLib/dist/RDKit_minimal.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script&gt;\n",
       "    // Set iframe height to fit content.\n",
       "    function fitIframe(iframe) {\n",
       "        // Ignore when there&#x27;s no iframe\n",
       "        if (!iframe) return\n",
       "\n",
       "        // Only fit height when no specific height was given.\n",
       "        if (iframe.getAttribute(&#x27;height&#x27;)) return;\n",
       "\n",
       "        // Initial fit + refit whenever the window width changes.\n",
       "        _fit()\n",
       "        $(window).on(&#x27;resize&#x27;, function() {\n",
       "            if (window.innerWidth != window.prevInnerWidth) {\n",
       "                window.prevInnerWidth = window.innerWidth\n",
       "                _fit();\n",
       "            }\n",
       "        })\n",
       "\n",
       "        // Fit iframe height to content height.\n",
       "        function _fit() {\n",
       "            var height = iframe.contentDocument.body.scrollHeight + 18 + &#x27;px&#x27;;\n",
       "            iframe.style.height = height;\n",
       "        }\n",
       "    }\n",
       "&lt;/script&gt;\n",
       "\n",
       "&lt;!-- prettier-ignore --&gt;\n",
       "&lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js&quot; integrity=&quot;sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;\n",
       "        \n",
       "        &lt;!-- Custom header --&gt;\n",
       "        \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "    &lt;/head&gt;\n",
       "    &lt;body class=&quot;m2g-inside-iframe&quot;&gt;\n",
       "\n",
       "\n",
       "\n",
       "        &lt;div id=&quot;mols2grid&quot; class=&quot;grid-default&quot;&gt;\n",
       "            &lt;!-- Pagination &amp; search --&gt;\n",
       "            &lt;div class=&quot;m2g-functions&quot;&gt;\n",
       "                \n",
       "                &lt;div class=&quot;m2g-row&quot;&gt;\n",
       "                    &lt;!-- Pagination --&gt;\n",
       "                    &lt;ul class=&quot;m2g-pagination&quot; class=&quot;d-flex&quot;&gt;&lt;/ul&gt;\n",
       "                    &lt;div class=&quot;m2g-gap&quot;&gt;&lt;/div&gt;\n",
       "\n",
       "                    &lt;!-- Sort dropdown --&gt;\n",
       "                    &lt;div class=&quot;m2g-dropdown m2g-sort&quot;&gt;\n",
       "                        &lt;select&gt;\n",
       "                            \n",
       "                            \n",
       "                                \n",
       "                                \n",
       "                                \n",
       "                            &lt;option value=&quot;mols2grid-id&quot; selected&gt;Index&lt;/option&gt;\n",
       "                                \n",
       "                            \n",
       "                                \n",
       "                                \n",
       "                                \n",
       "                            &lt;option value=&quot;data-SMILES&quot;&gt;SMILES&lt;/option&gt;\n",
       "                                \n",
       "                            \n",
       "                            \n",
       "                            &lt;option value=&quot;checkbox&quot;&gt;Selected&lt;/option&gt;\n",
       "                            \n",
       "                        &lt;/select&gt;\n",
       "                        &lt;div class=&quot;m2g-order&quot;&gt;&lt;/div&gt;\n",
       "                        &lt;div class=&quot;m2g-display&quot;&gt;\n",
       "                            Index\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "                &lt;/div&gt;\n",
       "                &lt;div class=&quot;m2g-row&quot;&gt;\n",
       "                    &lt;!-- Search bar --&gt;\n",
       "                    &lt;div class=&quot;m2g-search-wrap&quot;&gt;\n",
       "                        &lt;input\n",
       "                            type=&quot;text&quot;\n",
       "                            class=&quot;m2g-searchbar form-control&quot;\n",
       "                            placeholder=&quot;Search&quot;\n",
       "                            aria-label=&quot;Search&quot;\n",
       "                            aria-describedby=&quot;basic-addon1&quot;\n",
       "                        /&gt;\n",
       "                        &lt;div class=&quot;m2g-search-options&quot;&gt;\n",
       "                            &lt;div class=&quot;m2g-option m2g-search-text sel&quot;&gt;Text&lt;/div&gt;\n",
       "                            &lt;div class=&quot;m2g-option m2g-search-smarts&quot;&gt;SMARTS&lt;/div&gt;\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "\n",
       "                    &lt;!-- Action dropdown --&gt;\n",
       "                    &lt;div class=&quot;m2g-dropdown m2g-actions&quot;&gt;\n",
       "                        &lt;select&gt;\n",
       "                            &lt;option hidden&gt;-&lt;/option&gt;\n",
       "                            &lt;option value=&quot;select-all&quot;&gt;Select all&lt;/option&gt;\n",
       "                            &lt;option value=&quot;select-matching&quot;&gt;Select matching&lt;/option&gt;\n",
       "                            &lt;option value=&quot;unselect-all&quot;&gt;Unselect all&lt;/option&gt;\n",
       "                            &lt;option value=&quot;invert&quot;&gt;Invert&lt;/option&gt;\n",
       "                            &lt;option value=&quot;copy&quot;&gt;Copy to clipboard&lt;/option&gt;\n",
       "                            &lt;option value=&quot;save-smiles&quot;&gt;Save SMILES&lt;/option&gt;\n",
       "                            &lt;option value=&quot;save-csv&quot;&gt;Save CSV&lt;/option&gt;\n",
       "                        &lt;/select&gt;\n",
       "                        &lt;div class=&quot;m2g-icon&quot;&gt;\n",
       "                            &lt;svg width=&quot;20&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;\n",
       "                                &lt;path d=&quot;M11.5 4C11.5 4.82843 10.8284 5.5 10 5.5C9.17157 5.5 8.5 4.82843 8.5 4C8.5 3.17157 9.17157 2.5 10 2.5C10.8284 2.5 11.5 3.17157 11.5 4ZM11.5 10C11.5 10.8284 10.8284 11.5 10 11.5C9.17157 11.5 8.5 10.8284 8.5 10C8.5 9.17157 9.17157 8.5 10 8.5C10.8284 8.5 11.5 9.17157 11.5 10ZM10 17.5C10.8284 17.5 11.5 16.8284 11.5 16C11.5 15.1716 10.8284 14.5 10 14.5C9.17157 14.5 8.5 15.1716 8.5 16C8.5 16.8284 9.17157 17.5 10 17.5Z&quot;/&gt;\n",
       "                            &lt;/svg&gt;\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "                &lt;/div&gt;\n",
       "            &lt;/div&gt;\n",
       "\n",
       "            &lt;!-- Grid --&gt;\n",
       "            \n",
       "            &lt;div class=&quot;m2g-list&quot;&gt;&lt;div class=&quot;m2g-cell&quot; data-mols2grid-id=&quot;0&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;m2g-cb-wrap&quot;&gt;&lt;input type=&quot;checkbox&quot; tabindex=&quot;-1&quot; class=&quot;position-relative float-left cached_checkbox&quot;&gt;&lt;div class=&quot;m2g-cb&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data-mols2grid-id-display&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;m2g-cell-actions&quot;&gt;&lt;div class=&quot;m2g-info&quot;&gt;i&lt;/div&gt;&lt;/div&gt;&lt;a class=&quot;data data-img&quot;&gt;&lt;/a&gt;&lt;div class=&quot;data data-SMILES&quot; style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;m2g-tooltip&quot; data-toggle=&quot;popover&quot; data-content=&quot;.&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;\n",
       "        &lt;/div&gt;\n",
       "        &lt;script&gt;\n",
       "            // list.js\n",
       "var listObj = new List(&#x27;mols2grid&#x27;, {\n",
       "    listClass: &#x27;m2g-list&#x27;,\n",
       "    valueNames: [{data: [&#x27;mols2grid-id&#x27;]}, &#x27;data-mols2grid-id&#x27;, &#x27;data-SMILES&#x27;, &#x27;data-img&#x27;, &#x27;data-mols2grid-id-display&#x27;, {attr: &#x27;data-content&#x27;, name: &#x27;m2g-tooltip&#x27;}],\n",
       "    item: &#x27;&lt;div class=&quot;m2g-cell&quot; data-mols2grid-id=&quot;0&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;m2g-cb-wrap&quot;&gt;&lt;input type=&quot;checkbox&quot; tabindex=&quot;-1&quot; class=&quot;position-relative float-left cached_checkbox&quot;&gt;&lt;div class=&quot;m2g-cb&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data-mols2grid-id-display&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;m2g-cell-actions&quot;&gt;&lt;div class=&quot;m2g-info&quot;&gt;i&lt;/div&gt;&lt;/div&gt;&lt;a class=&quot;data data-img&quot;&gt;&lt;/a&gt;&lt;div class=&quot;data data-SMILES&quot; style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;m2g-tooltip&quot; data-toggle=&quot;popover&quot; data-content=&quot;.&quot;&gt;&lt;/div&gt;&lt;/div&gt;&#x27;,\n",
       "    page: 24,\n",
       "    pagination: {\n",
       "        paginationClass: &quot;m2g-pagination&quot;,\n",
       "        item: &#x27;&lt;li class=&quot;page-item&quot;&gt;&lt;a class=&quot;page page-link&quot; href=&quot;#&quot; onclick=&quot;event.preventDefault()&quot;&gt;&lt;/a&gt;&lt;/li&gt;&#x27;,\n",
       "        innerWindow: 1,\n",
       "        outerWindow: 1,\n",
       "    },\n",
       "});\n",
       "listObj.remove(&quot;mols2grid-id&quot;, &quot;0&quot;);\n",
       "listObj.add([{&quot;mols2grid-id&quot;: 0, &quot;data-SMILES&quot;: &quot;CCCCC&quot;, &quot;data-img&quot;: null, &quot;data-mols2grid-id-display&quot;: 0, &quot;m2g-tooltip&quot;: &quot;&lt;strong&gt;SMILES&lt;/strong&gt;: &lt;span class=\\&quot;copy-me\\&quot;&gt;CCCCC&lt;/span&gt;&quot;}, {&quot;mols2grid-id&quot;: 1, &quot;data-SMILES&quot;: &quot;CCC(C)C&quot;, &quot;data-img&quot;: null, &quot;data-mols2grid-id-display&quot;: 1, &quot;m2g-tooltip&quot;: &quot;&lt;strong&gt;SMILES&lt;/strong&gt;: &lt;span class=\\&quot;copy-me\\&quot;&gt;CCC(C)C&lt;/span&gt;&quot;}, {&quot;mols2grid-id&quot;: 2, &quot;data-SMILES&quot;: &quot;CC(C)(C)C&quot;, &quot;data-img&quot;: null, &quot;data-mols2grid-id-display&quot;: 2, &quot;m2g-tooltip&quot;: &quot;&lt;strong&gt;SMILES&lt;/strong&gt;: &lt;span class=\\&quot;copy-me\\&quot;&gt;CC(C)(C)C&lt;/span&gt;&quot;}, {&quot;mols2grid-id&quot;: 3, &quot;data-SMILES&quot;: &quot;C=CCC&quot;, &quot;data-img&quot;: null, &quot;data-mols2grid-id-display&quot;: 3, &quot;m2g-tooltip&quot;: &quot;&lt;strong&gt;SMILES&lt;/strong&gt;: &lt;span class=\\&quot;copy-me\\&quot;&gt;C=CCC&lt;/span&gt;&quot;}, {&quot;mols2grid-id&quot;: 4, &quot;data-SMILES&quot;: &quot;c1ccccc1&quot;, &quot;data-img&quot;: null, &quot;data-mols2grid-id-display&quot;: 4, &quot;m2g-tooltip&quot;: &quot;&lt;strong&gt;SMILES&lt;/strong&gt;: &lt;span class=\\&quot;copy-me\\&quot;&gt;c1ccccc1&lt;/span&gt;&quot;}]);\n",
       "\n",
       "\n",
       "// filter\n",
       "if (window.parent.mols2grid_lists === undefined) {\n",
       "    window.parent.mols2grid_lists = {};\n",
       "}\n",
       "window.parent.mols2grid_lists[&quot;default&quot;] = listObj;\n",
       "\n",
       "\n",
       "// selection\n",
       "class MolStorage extends Map {\n",
       "    multi_set(_id, _smiles) {\n",
       "        for (let i = 0; i &lt; _id.length; i++) {\n",
       "            this.set(_id[i], _smiles[i])\n",
       "        }\n",
       "    }\n",
       "    multi_del(_id) {\n",
       "        for (let i = 0; i &lt; _id.length; i++) {\n",
       "            this.delete(_id[i])\n",
       "        }\n",
       "    }\n",
       "    to_dict() {\n",
       "        var content = &#x27;{&#x27;\n",
       "        for (let [key, value] of this) {\n",
       "            content += key + &#x27;:&#x27; + JSON.stringify(value) + &#x27;,&#x27;\n",
       "        }\n",
       "        content = content.length &gt; 1 ? content.slice(0, -1) : content\n",
       "        content += &#x27;}&#x27;\n",
       "        return content\n",
       "    }\n",
       "    to_keys() {\n",
       "        var content = []\n",
       "        for (let [key] of this) {\n",
       "            content.push(key)\n",
       "        }\n",
       "        return content\n",
       "    }\n",
       "    download_smi(fileName, allItems) {\n",
       "        var content = &#x27;&#x27;\n",
       "\n",
       "        if (allItems) {\n",
       "            // Gather all smiles\n",
       "            for (var item of allItems) {\n",
       "                var smiles = item.values()[&#x27;data-SMILES&#x27;]\n",
       "                var id = item.values()[&#x27;mols2grid-id&#x27;]\n",
       "                content += smiles + &#x27; &#x27; + id + &#x27;\\n&#x27;\n",
       "            }\n",
       "        } else {\n",
       "            // Gather selected smiles\n",
       "            for (let [key, value] of this) {\n",
       "                content += value + &#x27; &#x27; + key + &#x27;\\n&#x27;\n",
       "            }\n",
       "        }\n",
       "\n",
       "        var a = document.createElement(&#x27;a&#x27;)\n",
       "        var file = new Blob([content], { type: &#x27;text/plain&#x27; })\n",
       "        a.href = URL.createObjectURL(file)\n",
       "        a.download = fileName\n",
       "        a.click()\n",
       "        a.remove()\n",
       "    }\n",
       "}\n",
       "var SELECTION = new MolStorage();\n",
       "\n",
       "\n",
       "\n",
       "// kernel\n",
       "function add_selection(grid_id, _id, smiles) {\n",
       "    SELECTION.multi_set(_id, smiles);\n",
       "    let model = window.parent[&quot;_MOLS2GRID_&quot; + grid_id];\n",
       "    if (model) {\n",
       "        model.set(&quot;selection&quot;, SELECTION.to_dict());\n",
       "        model.save_changes();\n",
       "    }\n",
       "}\n",
       "function del_selection(grid_id, _id) {\n",
       "    SELECTION.multi_del(_id);\n",
       "    let model = window.parent[&quot;_MOLS2GRID_&quot; + grid_id];\n",
       "    if (model) {\n",
       "        model.set(&quot;selection&quot;, SELECTION.to_dict());\n",
       "        model.save_changes();\n",
       "    }\n",
       "}\n",
       "if (window.parent.IPython !== undefined) {\n",
       "    // Jupyter notebook\n",
       "    var kernel_env = &quot;jupyter&quot;;\n",
       "} else if (window.parent.google !== undefined) {\n",
       "    // Google colab\n",
       "    var kernel_env = &quot;colab&quot;;\n",
       "} else {\n",
       "    var kernel_env = null;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "// sort\n",
       "var sortField = &#x27;mols2grid-id&#x27;\n",
       "var sortOrder = &#x27;asc&#x27;\n",
       "\n",
       "// Sort dropdown\n",
       "$(&#x27;#mols2grid .m2g-sort select&#x27;).change(sort)\n",
       "\n",
       "// Sort order\n",
       "$(&#x27;#mols2grid .m2g-order&#x27;).click(flipSort)\n",
       "\n",
       "function sort(e) {\n",
       "    if (e) {\n",
       "        sortField = e.target.value\n",
       "        var selectedOption = e.target.options[e.target.selectedIndex]\n",
       "        var sortFieldDisplay = selectedOption.text\n",
       "    }\n",
       "\n",
       "    // Sort\n",
       "    if (sortField == &#x27;checkbox&#x27;) {\n",
       "        listObj.sort(&#x27;mols2grid-id&#x27;, {order: sortOrder, sortFunction: checkboxSort})\n",
       "    } else {\n",
       "        listObj.sort(sortField, {order: sortOrder, sortFunction: mols2gridSortFunction})\n",
       "    }\n",
       "\n",
       "    // Update UI.\n",
       "    $(this).parent().find(&#x27;.m2g-display&#x27;).text(sortFieldDisplay)\n",
       "}\n",
       "\n",
       "// prettier-ignore\n",
       "function flipSort() {\n",
       "    $(this).parent().removeClass(&#x27;m2d-arrow-&#x27; + sortOrder)\n",
       "    sortOrder = sortOrder === &#x27;desc&#x27; ? &#x27;asc&#x27; : &#x27;desc&#x27;\n",
       "    $(this).parent().addClass(&#x27;m2d-arrow-&#x27; + sortOrder)\n",
       "    sort()\n",
       "}\n",
       "\n",
       "function mols2gridSortFunction(itemA, itemB, options) {\n",
       "    var x = itemA.values()[options.valueName]\n",
       "    var y = itemB.values()[options.valueName]\n",
       "    if (typeof x === &#x27;number&#x27;) {\n",
       "        if (isFinite(x - y)) {\n",
       "            return x - y\n",
       "        } else {\n",
       "            return isFinite(x) ? -1 : 1\n",
       "        }\n",
       "    } else {\n",
       "        x = x ? x.toLowerCase() : x\n",
       "        y = y ? y.toLowerCase() : y\n",
       "        return x &lt; y ? -1 : x &gt; y ? 1 : 0\n",
       "    }\n",
       "}\n",
       "function checkboxSort(itemA, itemB, options) {\n",
       "    if (itemA.elm !== undefined) {\n",
       "        var checkedA = itemA.elm.querySelector(&#x27;input[type=checkbox]&#x27;).checked\n",
       "        if (itemB.elm !== undefined) {\n",
       "            var checkedB = itemB.elm.querySelector(&#x27;input[type=checkbox]&#x27;).checked\n",
       "            if (checkedA &amp;&amp; !checkedB) {\n",
       "                return -1\n",
       "            } else if (!checkedA &amp;&amp; checkedB) {\n",
       "                return 1\n",
       "            } else {\n",
       "                return 0\n",
       "            }\n",
       "        } else {\n",
       "            return -1\n",
       "        }\n",
       "    } else if (itemB.elm !== undefined) {\n",
       "        return 1\n",
       "    } else {\n",
       "        return 0\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "// tooltips\n",
       "$.fn.tooltip.Constructor.Default.whiteList.span = [&#x27;style&#x27;]\n",
       "listObj.on(&quot;updated&quot;, function (list) {\n",
       "    $(function () {\n",
       "        // Hide previous popovers.\n",
       "        $(&#x27;#mols2grid a.page-link&#x27;).click(function(e) {\n",
       "            $(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;hide&#x27;)\n",
       "        });\n",
       "        // Create new popover.\n",
       "        $(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover({\n",
       "            placement: &#x27;auto&#x27;,\n",
       "            trigger: &#x27;manual&#x27;,\n",
       "            html: true,\n",
       "            sanitize: false,\n",
       "        });\n",
       "    })\n",
       "});\n",
       "\n",
       "\n",
       "// grid interactions (select, click, tooltip, key events)\n",
       "// Check if selection UI is supported.\n",
       "var supportSelection = eval(&#x27;True&#x27;.toLowerCase());\n",
       "\n",
       "listObj.on(&quot;updated&quot;, initInteraction);\n",
       "\n",
       "// (Re)initialiuze all grid interaction every time the grid changes.\n",
       "function initInteraction(list) {\n",
       "    initCellClick()\n",
       "    initToolTip()\n",
       "    initKeyboard()\n",
       "    if (supportSelection) initCheckbox()\n",
       "\n",
       "\n",
       "    // Hide pagination if there is only one page.\n",
       "    if (listObj.matchingItems.length &lt;= listObj.page) {\n",
       "        $(&#x27;#mols2grid .m2g-pagination&#x27;).hide()\n",
       "    } else {\n",
       "        $(&#x27;#mols2grid .m2g-pagination&#x27;).show()\n",
       "    }\n",
       "\n",
       "    // Add a bunch of phantom cells.\n",
       "    // These are used as filler to make sure that\n",
       "    // no grid cells need to be resized when there&#x27;s\n",
       "    // not enough results to fill the row.\n",
       "    $(&#x27;#mols2grid .m2g-list&#x27;).append(&#x27;&lt;div class=&quot;m2g-cell m2g-phantom&quot;&gt;&lt;/div&gt;&#x27;.repeat(11));\n",
       "}\n",
       "\n",
       "// Cell click handler.\n",
       "function initCellClick() {\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;click&#x27;).click(function(e) {\n",
       "        if ($(e.target).hasClass(&#x27;m2g-info&#x27;) || $(e.target).is(&#x27;:checkbox&#x27;)) {\n",
       "            // Info button / Checkbox --&gt; do nothing.\n",
       "        } else if ($(e.target).is(&#x27;div&#x27;) &amp;&amp; $(e.target).hasClass(&#x27;data&#x27;)) {\n",
       "            // Data string --&gt; copy text.\n",
       "            copyOnClick(e.target)\n",
       "        } else if ($(e.target).hasClass(&#x27;m2g-callback&#x27;)) {\n",
       "            // Callback button.\n",
       "            onCallbackButtonClick(e.target)\n",
       "        } else {\n",
       "            // Outside checkbox --&gt; toggle the checkbox.\n",
       "            if (supportSelection) {\n",
       "                var chkbox = $(this).find(&#x27;input:checkbox&#x27;)[0]\n",
       "                chkbox.checked = !chkbox.checked\n",
       "                $(chkbox).trigger(&#x27;change&#x27;)\n",
       "            }\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Store an element&#x27;s text content in the clipboard.\n",
       "function copyOnClick(target) {\n",
       "    var text = $(target).text()\n",
       "    navigator.clipboard.writeText(text)\n",
       "\n",
       "    // Blink the cell to indicate that the text was copied.\n",
       "    $(target).addClass(&#x27;m2g-copy-blink&#x27;)\n",
       "    setTimeout(function() {\n",
       "        $(target).removeClass(&#x27;m2g-copy-blink&#x27;)\n",
       "    }, 450)\n",
       "}\n",
       "\n",
       "// Keyboard actions.\n",
       "function initKeyboard() {\n",
       "    // Disable scroll when pressing UP/DOWN arrows\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;keydown&#x27;).keydown(function(e) {\n",
       "        if (e.which == 38 || e.which == 40) {\n",
       "            e.preventDefault()\n",
       "        }\n",
       "    })\n",
       "\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;keyup&#x27;).keyup(function(e) {\n",
       "        var chkbox = $(this).find(&#x27;input:checkbox&#x27;)[0]\n",
       "        if (e.which == 13) {\n",
       "            // ENTER: toggle\n",
       "            chkbox.checked = !chkbox.checked\n",
       "            $(chkbox).trigger(&#x27;change&#x27;)\n",
       "        } else if (e.which == 27 || e.which == 8) {\n",
       "            // ESC/BACKSPACE: unselect\n",
       "            chkbox.checked = false\n",
       "            $(chkbox).trigger(&#x27;change&#x27;)\n",
       "        } else if (e.which == 37) {\n",
       "            // LEFT\n",
       "            $(this).prev().focus()\n",
       "        } else if (e.which == 39) {\n",
       "            // RIGHT\n",
       "            $(this).next().focus()\n",
       "        } else if (e.which == 38 || e.which == 40) {\n",
       "            var containerWidth = $(this).parent().outerWidth()\n",
       "            var cellWidth = $(this).outerWidth() + parseInt($(this).css(&#x27;marginLeft&#x27;)) * 2\n",
       "            var columns = Math.round(containerWidth / cellWidth)\n",
       "            var index = $(this).index()\n",
       "            if (e.which == 38) {\n",
       "                // UP\n",
       "                var indexAbove = Math.max(index - columns, 0)\n",
       "                $(this).parent().children().eq(indexAbove).focus()\n",
       "            } else if (e.which == 40) {\n",
       "                // DOWN    \n",
       "                var total = $(this).parent().children().length\n",
       "                var indexBelow = Math.min(index + columns, total)\n",
       "                $(this).parent().children().eq(indexBelow).focus()\n",
       "            }\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Show tooltip when hovering the info icon.\n",
       "function initToolTip() {\n",
       "    $(&#x27;#mols2grid .m2g-info&#x27;).off(&#x27;mouseenter&#x27;).off(&#x27;mouseleave&#x27;).off(&#x27;click&#x27;).mouseenter(function() {\n",
       "        // Show on enter\n",
       "        $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;show&#x27;)\n",
       "        $(&#x27;body &gt; .popover&#x27;).click(function(e) {\n",
       "            if ($(e.target).hasClass(&#x27;copy-me&#x27;)) {\n",
       "                copyOnClick(e.target)\n",
       "            } else if ($(e.target).is(&#x27;button&#x27;)) {\n",
       "                \n",
       "            }\n",
       "        })\n",
       "    }).mouseleave(function() {\n",
       "        // Hide on leave, unless sticky.\n",
       "        if (!$(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;hide&#x27;)\n",
       "        }\n",
       "    }).click(function() {\n",
       "        // Toggle sticky on click.\n",
       "        $(this).closest(&#x27;.m2g-cell&#x27;).toggleClass(&#x27;m2g-keep-tooltip&#x27;)\n",
       "\n",
       "        // Hide tooltip when sticky was turned off.\n",
       "        if ($(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;show&#x27;)\n",
       "        } else if (!$(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;hide&#x27;)\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Update selection on checkbox click.\n",
       "function initCheckbox() {\n",
       "    $(&quot;input:checkbox&quot;).off(&#x27;change&#x27;).change(function() {\n",
       "        var _id = parseInt($(this).closest(&quot;.m2g-cell&quot;).attr(&quot;data-mols2grid-id&quot;));\n",
       "        if (this.checked) {\n",
       "            var _smiles = $($(this).closest(&quot;.m2g-cell&quot;).children(&quot;.data-SMILES&quot;)[0]).text();\n",
       "            add_selection(&quot;default&quot;, [_id], [_smiles]);\n",
       "        } else {\n",
       "            del_selection(&quot;default&quot;, [_id]);\n",
       "        }\n",
       "    });\n",
       "}\n",
       "\n",
       "// Callback button\n",
       "function onCallbackButtonClick(target) {\n",
       "    var data = {}\n",
       "    data[&quot;mols2grid-id&quot;] = parseInt($(target).closest(&quot;.m2g-cell&quot;)\n",
       "                                            .attr(&quot;data-mols2grid-id&quot;));\n",
       "    data[&quot;img&quot;] = $(target).parent().siblings(&quot;.data-img&quot;).eq(0).get(0).innerHTML;\n",
       "    $(target).parent().siblings(&quot;.data&quot;).not(&quot;.data-img&quot;).each(function() {\n",
       "        let name = this.className.split(&quot; &quot;)\n",
       "            .filter(cls =&gt; cls.startsWith(&quot;data-&quot;))[0]\n",
       "            .substring(5);\n",
       "        data[name] = this.innerHTML;\n",
       "    });\n",
       "\n",
       "    \n",
       "    // Call custom js callback.\n",
       "    None\n",
       "    \n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Actions\n",
       " */\n",
       "\n",
       "// Listen to action dropdown.\n",
       "$(&#x27;#mols2grid .m2g-actions select&#x27;).change(function(e) {\n",
       "    var val = e.target.value\n",
       "    switch(val) {\n",
       "        case &#x27;select-all&#x27;:\n",
       "            selectAll()\n",
       "            break\n",
       "        case &#x27;select-matching&#x27;:\n",
       "            selectMatching()\n",
       "            break\n",
       "        case &#x27;unselect-all&#x27;:\n",
       "            unselectAll()\n",
       "            break\n",
       "        case &#x27;invert&#x27;:\n",
       "            invertSelection()\n",
       "            break\n",
       "        case &#x27;copy&#x27;:\n",
       "            copy()\n",
       "            break\n",
       "        case &#x27;save-smiles&#x27;:\n",
       "            saveSmiles()\n",
       "            break\n",
       "        case &#x27;save-csv&#x27;:\n",
       "            saveCSV()\n",
       "            break\n",
       "    }\n",
       "    $(this).val(&#x27;&#x27;) // Reset dropdown\n",
       "})\n",
       "\n",
       "// Check all.\n",
       "function selectAll(e) {\n",
       "    var _id = [];\n",
       "    var _smiles = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "    });\n",
       "    add_selection(&quot;default&quot;, _id, _smiles);\n",
       "};\n",
       "\n",
       "\n",
       "// Check matching.\n",
       "function selectMatching(e) {\n",
       "    var _id = [];\n",
       "    var _smiles = [];\n",
       "    listObj.matchingItems.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "    });\n",
       "    add_selection(&quot;default&quot;, _id, _smiles);\n",
       "};\n",
       "\n",
       "// Uncheck all.\n",
       "function unselectAll(e) {\n",
       "    var _id = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = false;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = false;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "    });\n",
       "    del_selection(&quot;default&quot;, _id);\n",
       "};\n",
       "\n",
       "// Invert selection.\n",
       "function invertSelection(e) {\n",
       "    var _id_add = [];\n",
       "    var _id_del = [];\n",
       "    var _smiles = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            var chkbox = item.elm.getElementsByTagName(&quot;input&quot;)[0]\n",
       "            chkbox.checked = !chkbox.checked;\n",
       "        } else {\n",
       "            item.show()\n",
       "            var chkbox = item.elm.getElementsByTagName(&quot;input&quot;)[0]\n",
       "            chkbox.checked = !chkbox.checked;\n",
       "            item.hide()\n",
       "        }\n",
       "        if (chkbox.checked) {\n",
       "            _id_add.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "            _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "        } else {\n",
       "            _id_del.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        }\n",
       "    });\n",
       "    del_selection(&quot;default&quot;, _id_del);\n",
       "    add_selection(&quot;default&quot;, _id_add, _smiles);\n",
       "};\n",
       "\n",
       "// Copy to clipboard.\n",
       "function copy(e) {\n",
       "    // navigator.clipboard.writeText(SELECTION.to_dict());\n",
       "    content = _renderCSV(&#x27;\\t&#x27;)\n",
       "    navigator.clipboard.writeText(content)\n",
       "};\n",
       "\n",
       "// Export smiles.\n",
       "function saveSmiles(e) {\n",
       "    var fileName = &quot;selection.smi&quot;\n",
       "    if (SELECTION.size) {\n",
       "        // Download selected smiles\n",
       "        SELECTION.download_smi(fileName);\n",
       "    } else {\n",
       "        // Download all smiles\n",
       "        SELECTION.download_smi(fileName, listObj.items);\n",
       "    }\n",
       "};\n",
       "\n",
       "// Export CSV.\n",
       "function saveCSV(e) {\n",
       "    content = _renderCSV(&#x27;;&#x27;)\n",
       "    var a = document.createElement(&quot;a&quot;);\n",
       "    var file = new Blob([content], {type: &quot;text/csv&quot;});\n",
       "    a.href = URL.createObjectURL(file);\n",
       "    a.download = &quot;selection.csv&quot;;\n",
       "    a.click();\n",
       "    a.remove();\n",
       "};\n",
       "\n",
       "// Render CSV for export of clipboard.\n",
       "function _renderCSV(sep) {\n",
       "    // Same order as subset + tooltip\n",
       "    var columns = Array.from(listObj.items[0].elm.querySelectorAll(&quot;div.data&quot;))\n",
       "        .map(elm =&gt; elm.classList[1])\n",
       "        .filter(name =&gt; name !== &quot;data-img&quot;);\n",
       "    // Remove &#x27;data-&#x27; and img\n",
       "    var header = columns.map(name =&gt; name.slice(5));\n",
       "    // CSV content\n",
       "    header = [&quot;index&quot;].concat(header).join(sep);\n",
       "    var content = header + &quot;\\n&quot;;\n",
       "    listObj.items.forEach(function (item) {\n",
       "        let data = item.values();\n",
       "        let index = data[&quot;mols2grid-id&quot;];\n",
       "        if (SELECTION.has(index) || SELECTION.size === 0) {\n",
       "            content += index;\n",
       "            columns.forEach((key) =&gt; {\n",
       "                content += sep + data[key];\n",
       "            })\n",
       "            content += &quot;\\n&quot;;\n",
       "        }\n",
       "    });\n",
       "    return content\n",
       "}\n",
       "\n",
       "\n",
       "// generate images for the currently displayed molecules\n",
       "var draw_opts = {&quot;width&quot;: 130, &quot;height&quot;: 90};\n",
       "var json_draw_opts = JSON.stringify(draw_opts);\n",
       "\n",
       "var smarts_matches = {};\n",
       "\n",
       "// Load RDKit\n",
       "window\n",
       ".initRDKitModule()\n",
       ".then(function(RDKit) {\n",
       "    console.log(&#x27;RDKit version: &#x27;, RDKit.version());\n",
       "    window.RDKit = RDKit;\n",
       "    window.RDKitModule = RDKit;\n",
       "\n",
       "    // Searchbar\n",
       "    function SmartsSearch(query, columns) {\n",
       "    var smiles_col = columns[0];\n",
       "    smarts_matches = {};\n",
       "    var query = $(&#x27;#mols2grid .m2g-searchbar&#x27;).val();\n",
       "    var qmol = RDKit.get_qmol(query);\n",
       "    if (qmol.is_valid()) {\n",
       "        listObj.items.forEach(function (item) {\n",
       "            var smiles = item.values()[smiles_col]\n",
       "            var mol = RDKit.get_mol(smiles, &#x27;{&quot;removeHs&quot;: false }&#x27;);\n",
       "            if (mol.is_valid()) {\n",
       "                var results = mol.get_substruct_matches(qmol);\n",
       "                if (results === &quot;\\{\\}&quot;) {\n",
       "                    item.found = false;\n",
       "                } else {\n",
       "                    item.found = true;\n",
       "                    \n",
       "                    results = JSON.parse(results);\n",
       "                    \n",
       "                    var highlights = {&quot;atoms&quot;: [], &quot;bonds&quot;: []};\n",
       "                    results.forEach(function (match) {\n",
       "                        highlights[&quot;atoms&quot;].push(...match.atoms)\n",
       "                        highlights[&quot;bonds&quot;].push(...match.bonds)\n",
       "                    });\n",
       "                    \n",
       "                    var index = item.values()[&quot;mols2grid-id&quot;];\n",
       "                    smarts_matches[index] = highlights;\n",
       "                    \n",
       "                }\n",
       "            } else {\n",
       "                item.found = false;\n",
       "            }\n",
       "            mol.delete();\n",
       "        });\n",
       "    }\n",
       "    qmol.delete();\n",
       "}\n",
       "var search_type = &quot;Text&quot;;\n",
       "// Temporary fix for regex characters being escaped by list.js\n",
       "// This extends String.replace to ignore the regex pattern used by list.js and returns\n",
       "// the string unmodified. Other calls should not be affected, unless they use the exact\n",
       "// same pattern and replacement value.\n",
       "// TODO: remove once the issue is fixed in list.js and released\n",
       "String.prototype.replace = (function(_super) {\n",
       "    return function() {\n",
       "        if (\n",
       "            (arguments[0].toString() === &#x27;/[-[\\\\]{}()*+?.,\\\\\\\\^$|#]/g&#x27;)\n",
       "            &amp;&amp; (arguments[1] === &#x27;\\\\$&amp;&#x27;)\n",
       "        ) {\n",
       "            if (this.length === 0) {\n",
       "                return &#x27;&#x27;\n",
       "            }\n",
       "            return this\n",
       "        }\n",
       "        return _super.apply(this, arguments);\n",
       "    };         \n",
       "})(String.prototype.replace);\n",
       "\n",
       "// Switch search type (Text or SMARTS)\n",
       "$(&#x27;#mols2grid .m2g-search-options .m2g-option&#x27;).click(function() {\n",
       "    search_type = $(this).text();\n",
       "    $(&#x27;#mols2grid .m2g-search-options .m2g-option.sel&#x27;).removeClass(&quot;sel&quot;);\n",
       "    $(this).addClass(&quot;sel&quot;);\n",
       "});\n",
       "\n",
       "// Searchbar update event handler\n",
       "$(&#x27;#mols2grid .m2g-searchbar&#x27;).on(&quot;keyup&quot;, function(e) {\n",
       "    var query = e.target.value;\n",
       "    if (search_type === &quot;Text&quot;) {\n",
       "        smarts_matches = {};\n",
       "        listObj.search(query, [&#x27;data-mols2grid-id&#x27;, &#x27;data-SMILES&#x27;]);\n",
       "    } else {\n",
       "        listObj.search(query, [&quot;data-SMILES&quot;], SmartsSearch);\n",
       "    }\n",
       "});\n",
       "\n",
       "    \n",
       "    // Generate images for the currently displayed molecules.\n",
       "RDKit.prefer_coordgen(true);\n",
       "function draw_mol(smiles, index, template_mol) {\n",
       "    var mol = RDKit.get_mol(smiles, &#x27;{&quot;removeHs&quot;: false }&#x27;);\n",
       "    var svg = &quot;&quot;;\n",
       "    if (mol.is_valid()) {\n",
       "        var highlights = smarts_matches[index];\n",
       "        if (highlights) {\n",
       "            var details = Object.assign({}, draw_opts, highlights);\n",
       "            details = JSON.stringify(details);\n",
       "            mol.generate_aligned_coords(template_mol, true);\n",
       "        } else {\n",
       "            var details = json_draw_opts;\n",
       "        }\n",
       "        svg = mol.get_svg_with_highlights(details);\n",
       "    }\n",
       "    mol.delete();\n",
       "    if (svg == &quot;&quot;) {\n",
       "        return &#x27;&lt;svg width=&quot;130&quot; height=&quot;90&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 130 90&quot;&gt;&lt;/svg&gt;&#x27;;\n",
       "    }\n",
       "    return svg;\n",
       "}\n",
       "\n",
       "// Update images when the list is updated.\n",
       "listObj.on(&quot;updated&quot;, function (list) {\n",
       "    var query = $(&#x27;#mols2grid .m2g-searchbar&#x27;).val();\n",
       "    var template_mol;\n",
       "    if (query === &quot;&quot;) {\n",
       "        smarts_matches = {};\n",
       "        template_mol = null;\n",
       "    } else {\n",
       "        template_mol = RDKit.get_qmol(query);\n",
       "        template_mol.set_new_coords(true);\n",
       "    }\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).each(function() {\n",
       "        var $t = $(this);\n",
       "        var smiles = $t.children(&quot;.data-SMILES&quot;).first().text();\n",
       "        var index = parseInt(this.getAttribute(&quot;data-mols2grid-id&quot;));\n",
       "        var svg = draw_mol(smiles, index, template_mol);\n",
       "        $t.children(&quot;.data-img&quot;).html(svg);\n",
       "    });\n",
       "    if (template_mol) {\n",
       "        template_mol.delete();\n",
       "    }\n",
       "});\n",
       "    \n",
       "\n",
       "    // Trigger update to activate tooltips, draw images, setup callbacks...\n",
       "    listObj.update();\n",
       "    \n",
       "    // Set iframe height to fit content.\n",
       "    fitIframe(window.frameElement);\n",
       "});\n",
       "        &lt;/script&gt;\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\n",
       "\">\n",
       "</iframe>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import mols2grid\n",
    "mols2grid.display(mol_list,substruct_highlight=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1922d1f5",
   "metadata": {},
   "source": [
    "### Additional Atom Primitives\n",
    "Use the grid below to try out of some other SMARTS atom primitives.  The table below was taken from [The RDKit Book](https://www.rdkit.org/docs/RDKit_Book.html)\n",
    "<img src=\"https://raw.githubusercontent.com/PatWalters/practical_cheminformatics_tutorials/main/images/smarts_atom_primitives.png\" width=\"800\"/>\n",
    "\n",
    "See if you can find: \n",
    "- All the molecules with a six membered ring\n",
    "- All the molecules with a four membered ring\n",
    "- All the carboxylic acids\n",
    "- All the esters\n",
    "- All the primary amines\n",
    "- All the sp2 hybridized carbons\n",
    "- All the atoms contained in 2 rings\n",
    "- Ureas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "458eea78",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:41.141421Z",
     "start_time": "2025-05-05T16:56:40.969426Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ebd3832f0900406b81352949d0157584",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "MolGridWidget()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<style>\n",
       "    /* Some CSS to integrate with Jupyter more cleanly */\n",
       "    div.output_subarea {\n",
       "        /* Undo an unfortunate max-width parameter\n",
       "        that causes the output area to be too narrow\n",
       "        on smaller screens. */\n",
       "        max-width: none;\n",
       "\n",
       "        /* Align the table with the content */\n",
       "        padding: 0;\n",
       "\n",
       "        /* Let it breathe */\n",
       "        margin-top: 20px;\n",
       "    }\n",
       "</style>\n",
       "\n",
       "<iframe class=\"mols2grid-iframe\" frameborder=\"0\" width=\"100%\"\n",
       "    \n",
       "    \n",
       "    allow=\"clipboard-write\"\n",
       "    \n",
       "    \n",
       "    sandbox=\"allow-scripts allow-same-origin allow-downloads allow-popups allow-modals\"\n",
       "    \n",
       "    srcdoc=\"\n",
       "\n",
       "\n",
       "\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;UTF-8&quot; /&gt;\n",
       "        &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt;\n",
       "        &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;\n",
       "        &lt;title&gt;Document!&lt;/title&gt;\n",
       "\n",
       "\n",
       "\n",
       "        &lt;style&gt;\n",
       "            /**\n",
       " * General styling\n",
       " */\n",
       "body {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "}\n",
       "h1,h2,h3,h4 {\n",
       "    margin: 0 0 10px 0;\n",
       "}\n",
       "h1 {\n",
       "    font-size: 26px;\n",
       "}\n",
       "h2 {\n",
       "    font-size: 20px;\n",
       "    font-weight: 400;\n",
       "}\n",
       "h3 {\n",
       "\tfont-size: 16px;\n",
       "}\n",
       "p {\n",
       "    margin: 0 0 10px 0;\n",
       "}\n",
       "\n",
       "\n",
       "/* Remove body margin inside iframe */\n",
       "body.m2g-inside-iframe {\n",
       "    margin: 0;\n",
       "}\n",
       "\n",
       "/* In-cell text */\n",
       "#mols2grid .data:not(.data-img) {\n",
       "    height: 16px;\n",
       "    line-height: 16px;\n",
       "}\n",
       "/* Text truncation */\n",
       "#mols2grid .data {\n",
       "    /* Break text into multiple lines (default for static)... */\n",
       "    word-wrap: normal;\n",
       "\n",
       "    /* ...or truncate it (default for interactive). */\n",
       "    overflow: hidden;\n",
       "    white-space: nowrap;\n",
       "    text-overflow: ellipsis;\n",
       "}\n",
       "\n",
       "\n",
       "/**\n",
       " * Popover\n",
       " * - - -\n",
       " * Note: this is a bootstrap variable which is not namespaced.\n",
       " * To avoid any contamination, we only style it when the\n",
       " * x-placement parameter is set.\n",
       " */\n",
       ".popover[x-placement] {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    background: white;\n",
       "    border: solid 1px rgba(0,0,0,.2);\n",
       "    font-size: 12px;\n",
       "    padding: 10px;\n",
       "    border-radius: 5px;\n",
       "    box-shadow: 0 0 20px rgba(0,0,0,.15);\n",
       "    user-select: none;\n",
       "}\n",
       ".popover[x-placement] h3 {\n",
       "    margin: 0;\n",
       "}\n",
       ".popover[x-placement] .arrow {\n",
       "    width: 10px;\n",
       "    height: 10px;\n",
       "    background: #fff;\n",
       "    border: solid 1px rgba(0,0,0,.2);\n",
       "    box-sizing: border-box;\n",
       "    position: absolute;\n",
       "    transform-origin: 5px 5px;\n",
       "    clip-path: polygon(0 0, 100% 0, 100% 100%);\n",
       "}\n",
       ".popover[x-placement=&#x27;left&#x27;] .arrow {\n",
       "    transform: rotate(45deg);\n",
       "    top: 50%;\n",
       "    right: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;right&#x27;] .arrow {\n",
       "    transform: rotate(-135deg);\n",
       "    top: 50%;\n",
       "    left: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;top&#x27;] .arrow {\n",
       "    transform: rotate(135deg);\n",
       "    left: 50%;\n",
       "    bottom: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;bottom&#x27;] .arrow {\n",
       "    transform: rotate(-45deg);\n",
       "    left: 50%;\n",
       "    top: -5px;\n",
       "}\n",
       "            body {\n",
       "    /* Colors */\n",
       "    --m2g-black: rgba(0,0,0,.75);\n",
       "    --m2g-black-soft: rgba(0,0,0,.35);\n",
       "    --m2g-black-10: rgba(0,0,0,.1);\n",
       "    --m2g-bg: #f6f6f6;\n",
       "    --m2g-border: solid 1px rgba(0,0,0,0.2);\n",
       "    --m2g-hl: #555; /* Highlight color */\n",
       "    --m2g-hl-shadow: inset 0 0 0 1px var(--m2g-hl); /* Inset 1px shadow to make border thicker */\n",
       "    --m2g-blue: #0f62fe;\n",
       "    --m2g-blue-soft: rgba(15,98,254,.2);\n",
       "\n",
       "    /* Icons */\n",
       "    --m2g-icn-triangle: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;20&quot; fill=&quot;rgba(0,0,0,.75)&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M9.5713 13.285L6.2543 7.757C6.0543 7.424 6.2953 7 6.6823 7L13.3173 7C13.7053 7 13.9463 7.424 13.7453 7.757L10.4283 13.285C10.2343 13.609 9.7653 13.609 9.5713 13.285Z&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    --m2g-icn-triangle-white: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;20&quot; fill=&quot;white&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M9.5713 13.285L6.2543 7.757C6.0543 7.424 6.2953 7 6.6823 7L13.3173 7C13.7053 7 13.9463 7.424 13.7453 7.757L10.4283 13.285C10.2343 13.609 9.7653 13.609 9.5713 13.285Z&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    --m2g-icn-cb-white: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 16 16&quot; fill=&quot;none&quot; stroke=&quot;white&quot; stroke-width=&quot;2.5&quot; stroke-linecap=&quot;round&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M4 7.65686L7 10.6569L12.6569 5.00001&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    \n",
       "    /* Border radius */\n",
       "    --m2g-br: 3px;\n",
       "    --m2g-br-l: var(--m2g-br) 0 0 var(--m2g-br); /* Left-only */\n",
       "    --m2g-br-r: 0 var(--m2g-br) var(--m2g-br) 0; /* Right-only */\n",
       "\n",
       "    /* Text */\n",
       "    --m2g-fs: 14px; /* UI font-size */\n",
       "    --m2g-fs-cell: 12px; /* Cell font-size */\n",
       "\n",
       "    /* Transition speeds */\n",
       "    --m2g-trans: 150ms;\n",
       "\n",
       "    /* Layout */\n",
       "    --m2g-h: 40px; /* Form element height */\n",
       "}\n",
       "\n",
       "/* Styling */\n",
       "#mols2grid {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    font-size: var(--m2g-fs);\n",
       "}\n",
       "\n",
       "/* Fixes */\n",
       "#mols2grid *,\n",
       "#mols2grid *::before,\n",
       "#mols2grid *::after {\n",
       "    box-sizing: border-box;\n",
       "    outline: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Functions section\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-functions {\n",
       "    display: flex;\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-row {\n",
       "    flex: 0;\n",
       "    display: flex;\n",
       "}\n",
       "\n",
       "/* Individual elements don&#x27;t scale */\n",
       "#mols2grid .m2g-functions .m2g-row &gt; * {\n",
       "    flex: 0 0;\n",
       "    margin-right: 10px;\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-row:last-child &gt; *:last-child {\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "/* Row 1: pagination + gap + sort */\n",
       "#mols2grid .m2g-functions .m2g-row:first-child {\n",
       "    flex: 1; /* Scale */\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-gap {\n",
       "    /* The gap in between will scale, so the pagination\n",
       "    stays on the left, while the rest moves to the right */\n",
       "    flex: 1;\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Pagination\n",
       " */\n",
       "\n",
       "#mols2grid ul.m2g-pagination {\n",
       "    /* Unset defaults */\n",
       "    list-style-type: none;\n",
       "    margin-block-start: 0;\n",
       "    margin-block-end: 0;\n",
       "    margin-inline-start: 0;\n",
       "    margin-inline-end: 0;\n",
       "    padding-inline-start: 0;\n",
       "\n",
       "    /* Custom */\n",
       "    display: flex;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li {\n",
       "    background: var(--m2g-bg) ;\n",
       "    border: var(--m2g-border);\n",
       "    height: var(--m2g-h);\n",
       "    min-width: calc(var(--m2g-h) + 1px);\n",
       "    position: relative;\n",
       "    user-select: none;\n",
       "    \n",
       "    /* Compensate for double border */\n",
       "    margin-right: -1px;\n",
       "    \n",
       "    /* Center text */\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li:last-child {\n",
       "    min-width: var(--m2g-h);\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li a {\n",
       "    text-decoration: none;\n",
       "    color: var(--m2g-black);\n",
       "    padding: 0 10px;\n",
       "    width: 100%;\n",
       "    height: var(--m2g-h);\n",
       "    line-height: var(--m2g-h);\n",
       "    text-align: center;\n",
       "    /* Compensate for border so there&#x27;s no gap between click areas  */\n",
       "    margin: 0 -1px;\n",
       "}\n",
       "\n",
       "/* Corner shape */\n",
       "#mols2grid ul.m2g-pagination li:first-child {\n",
       "    border-radius: var(--m2g-br-l);\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li:last-child {\n",
       "    border-radius: var(--m2g-br-r);\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid ul.m2g-pagination li:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "    z-index: 1;\n",
       "}\n",
       "\n",
       "/* Active state */\n",
       "#mols2grid ul.m2g-pagination li.active {\n",
       "    background: var(--m2g-hl);\n",
       "    z-index: 1;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li.active a {\n",
       "    cursor: default;\n",
       "    color: #fff;\n",
       "}\n",
       "\n",
       "/* Disabled sate */\n",
       "#mols2grid ul.m2g-pagination li.disabled a {\n",
       "    cursor: default;\n",
       "    color: rgba(0,0,0,.25);\n",
       "    pointer-events: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Dropdowns\n",
       " */\n",
       "\n",
       "#mols2grid ::placeholder {\n",
       "    color: var(--m2g-black-soft);\n",
       "}\n",
       "#mols2grid .m2g-dropdown {\n",
       "    height: var(--m2g-h);\n",
       "    background: var(--m2g-bg);\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: var(--m2g-br);\n",
       "    position: relative;\n",
       "}\n",
       "#mols2grid .m2g-dropdown select {\n",
       "    -webkit-appearance: none;\n",
       "    -moz-appearance: none;\n",
       "    -ms-appearance: none;\n",
       "    appearance: none;\n",
       "    background: transparent;\n",
       "    border: none;\n",
       "    height: 100%;\n",
       "    padding: 0 13px;\n",
       "    min-width: 0;\n",
       "    max-width: 250px;\n",
       "    color: var(--m2g-black);\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       "/* Icon */\n",
       "#mols2grid .m2g-dropdown .m2g-icon {\n",
       "    width: 30px;\n",
       "    height: var(--m2g-h);\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "    position: absolute;\n",
       "    top: 0;\n",
       "    right: 0;\n",
       "    pointer-events: none;\n",
       "}\n",
       "#mols2grid .m2g-dropdown .m2g-icon svg:not(.m2g-stroke) {\n",
       "    fill: var(--m2g-black);\n",
       "}\n",
       "#mols2grid .m2g-dropdown .m2g-icon svg.m2g-stroke {\n",
       "    stroke: var(--m2g-black);\n",
       "}\n",
       "\n",
       "/* Display */\n",
       "/* We hide the native select element because\n",
       " * it is limited in styling. Instead, we display\n",
       " * the selected value in a div. */\n",
       "#mols2grid .m2g-dropdown .m2g-display {\n",
       "    position: absolute;\n",
       "    left: 0;\n",
       "    right: 0;\n",
       "    top: 0;\n",
       "    bottom: 0;\n",
       "    pointer-events: none;\n",
       "    color: var(--m2g-black);\n",
       "    line-height: var(--m2g-h);\n",
       "    padding: 0 25px 0 13px;\n",
       "\n",
       "    /* Truncate dropdown text */\n",
       "    white-space: nowrap;\n",
       "\ttext-overflow: ellipsis;\n",
       "\toverflow: hidden;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-dropdown:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Action dropdown\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-dropdown.m2g-actions {\n",
       "    width: var(--m2g-h);\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-actions select {\n",
       "    opacity: 0;\n",
       "    width: var(--m2g-h);\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-actions .m2g-icon {\n",
       "    width: var(--m2g-h);\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Sort dropdown\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-dropdown.m2g-sort {\n",
       "    flex: 0 0 200px;\n",
       "    width: 200px; /* Needed in addition to flex-basis for small sizes! */\n",
       "    border-radius: var(--m2g-br);\n",
       "    background: var(--m2g-bg);\n",
       "    display: flex;\n",
       "}\n",
       "\n",
       "/* Dropdown */\n",
       "#mols2grid .m2g-dropdown.m2g-sort select {\n",
       "    flex: 1 1;\n",
       "    opacity: 0;\n",
       "    /* padding-right: 70px; Space for &quot;Sort:&quot; */\n",
       "    box-sizing: border-box;\n",
       "}\n",
       "\n",
       "/* Sort order */\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-order {\n",
       "    background: var(--m2g-bg) var(--m2g-icn-triangle) no-repeat center;\n",
       "    flex: 0 0 30px;\n",
       "    height: 100%;\n",
       "    border-left: var(--m2g-border);\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-sort.m2d-arrow-desc .m2g-order {\n",
       "    transform: rotate(180deg);\n",
       "    border-left: none;\n",
       "    border-right: var(--m2g-border);\n",
       "}\n",
       "\n",
       "/* Display */\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-display {\n",
       "    right: 31px;\n",
       "    padding-right: 13px;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-display::before {\n",
       "    content: &#x27;Sort: &#x27;;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-dropdown.m2g-sort:focus-within .m2g-display,\n",
       "#mols2grid .m2g-dropdown.m2g-sort:focus-within .m2g-order {\n",
       "    background-color: transparent;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Search bar\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-search-wrap {\n",
       "    height: var(--m2g-h);\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: flex-end;\n",
       "    background: var(--m2g-bg);\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: var(--m2g-br);\n",
       "}\n",
       "#mols2grid .m2g-searchbar {\n",
       "    width: 170px;\n",
       "    height: var(--m2g-h);\n",
       "    padding: 0 13px;\n",
       "    border: none;\n",
       "    color: var(--m2g-black);\n",
       "    cursor: text;\n",
       "    background: transparent;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-search-wrap:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "/* Option buttons */\n",
       "#mols2grid .m2g-search-options {\n",
       "    font-size: 12px;\n",
       "    display: flex;\n",
       "    height: calc(1.5em + .75rem);\n",
       "    line-height: calc(1.5em + .75rem);\n",
       "    margin-right: 5px;\n",
       "    border-radius: var(--m2g-br);\n",
       "    color: var(--m2g-black);\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option {\n",
       "    background: var(--m2g-black-10);\n",
       "    padding: 0 13px;\n",
       "    cursor: default;\n",
       "    user-select: none;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:not(.sel) {\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:first-child {\n",
       "    border-radius: 2px 0 0 2px;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:last-child {\n",
       "    border-radius: 0 2px 2px 0;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option.sel {\n",
       "    background: var(--m2g-hl);\n",
       "    color: #fff;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Grid\n",
       " */\n",
       "\n",
       "/* Container */\n",
       "#mols2grid .m2g-list {\n",
       "    display: flex;\n",
       "    flex-wrap: wrap;\n",
       "    align-items: flex-start;\n",
       "    justify-content: flex-start;\n",
       "    padding: 1px; /* Compensate for negative padding on cell */\n",
       "    user-select: none;\n",
       "    margin: 0px;\n",
       "    margin-top: 20px;\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    \n",
       "}\n",
       "\n",
       "/* Cell */\n",
       "#mols2grid .m2g-cell {\n",
       "    border: 1px solid #cccccc;\n",
       "    text-align: center;\n",
       "    vertical-align: top;\n",
       "    font-family: var(--font-family);\n",
       "    padding: 10px;\n",
       "    padding-top: max(10px, 20px);\n",
       "    margin: -1px -1px 0 0;\n",
       "    flex: 1 0 130px;\n",
       "    position: relative;\n",
       "    font-size: var(--m2g-fs-cell);\n",
       "    cursor: pointer;\n",
       "    color: var(--m2g-black);\n",
       "    overflow: hidden;\n",
       "    box-sizing: border-box;\n",
       "    background-color: white;\n",
       "}\n",
       "#mols2grid .m2g-cell:focus {\n",
       "    z-index: 1;\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "/* Phantom cells to maintain grid structure with less results */\n",
       "#mols2grid .m2g-cell.m2g-phantom {\n",
       "    border: none;\n",
       "    pointer-events: none;\n",
       "    height: 0;\n",
       "    padding: 0;\n",
       "}\n",
       "\n",
       "/* Checkbox &amp; ID */\n",
       "#mols2grid .m2g-cb-wrap {\n",
       "    position: absolute;\n",
       "    top: 3px;\n",
       "    left: 3px;\n",
       "    display: flex;\n",
       "    border-radius: 2px;\n",
       "    font-size: 0;\n",
       "    line-height: 0;\n",
       "    padding: 3px;\n",
       "    padding-right: 0;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] {\n",
       "    display: none;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] + .m2g-cb {\n",
       "\twidth: 16px;\n",
       "\theight: 16px;\n",
       "\tbox-sizing: border-box;\n",
       "\tbackground: #fff;\n",
       "\tborder: var(--m2g-border);\n",
       "\tborder-radius: 2px;\n",
       "    margin-right: 5px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox]:checked + .m2g-cb {\n",
       "    border: none;\n",
       "    background-color: var(--m2g-blue);\n",
       "    background-image: var(--m2g-icn-cb-white);\n",
       "}\n",
       "#mols2grid .m2g-tooltip {\n",
       "    /* This is a div spanning full cell size where the\n",
       "    tooltip is rendered around, because you can&#x27;t attach\n",
       "    it to the parent due to list.js limitation. */\n",
       "    width: 100%;\n",
       "    height: 100%;\n",
       "    position: absolute;\n",
       "    left: 0;\n",
       "    top: 0;\n",
       "    z-index: -1;\n",
       "    pointer-events: none;\n",
       "    opacity: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell:has(:checked) {\n",
       "    background: #ffd !important; /* Overrides user-set background color */\n",
       "}\n",
       "#mols2grid .data-mols2grid-id-display {\n",
       "    font-size: var(--m2g-fs-cell);\n",
       "    line-height: 16px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] + .data-mols2grid-id-display {\n",
       "    padding: 0 5px 0 5px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap .data-name-display {\n",
       "    font-size: var(--m2g-fs);\n",
       "    line-height: 16px;\n",
       "}\n",
       "\n",
       "/* Info + callback button wrap (28px high) */\n",
       "#mols2grid .m2g-cell-actions {\n",
       "    position: absolute;\n",
       "    top: 0;\n",
       "    right: 0;\n",
       "    display: flex;\n",
       "    flex-direction: row;\n",
       "    font-size: 0;\n",
       "    line-height: 0;\n",
       "    \n",
       "    /* background: yellow; */\n",
       "}\n",
       "\n",
       "/* Info button */\n",
       "#mols2grid .m2g-info {\n",
       "    width: 28px;\n",
       "    height: 28px;\n",
       "    border-radius: 2px;\n",
       "    line-height: 28px;\n",
       "    font-size: min(14px, 12px);\n",
       "    font-family: Georgia, serif;\n",
       "    font-style: italic;\n",
       "    padding: 0;\n",
       "    text-align: center;\n",
       "}\n",
       "#mols2grid .m2g-keep-tooltip .m2g-info {\n",
       "    color: #fff;\n",
       "}\n",
       "#mols2grid .m2g-keep-tooltip .m2g-info::before {\n",
       "    content: &#x27;i&#x27;;\n",
       "    width: 18px;\n",
       "    height: 18px;\n",
       "    line-height: 18px;\n",
       "    background: var(--m2g-hl);\n",
       "    position: absolute;\n",
       "    left: 5px;\n",
       "    top: 5px;\n",
       "    border-radius: 9px;\n",
       "}\n",
       "\n",
       "/* Callback button */\n",
       "#mols2grid .m2g-callback {\n",
       "    width: 28px;\n",
       "    height: 28px;\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-callback::after {\n",
       "    content: &#x27;&#x27;;\n",
       "    display: block;\n",
       "    width: 16px;\n",
       "    height: 16px;\n",
       "    margin: 6px;\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: 2px;\n",
       "    background: var(--m2g-bg) var(--m2g-icn-triangle) no-repeat center;\n",
       "    transform: rotate(-90deg);\n",
       "}\n",
       "\n",
       "/* Image */\n",
       "#mols2grid .m2g-cell .data-img {\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell img,\n",
       "#mols2grid .m2g-cell svg {\n",
       "    max-width: 100%;\n",
       "    height: auto;\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell svg &gt; rect:first-child {\n",
       "    /* Remove the SVG background */\n",
       "    fill: transparent !important;\n",
       "}\n",
       "\n",
       "/* Text below image */\n",
       ".m2g-copy-blink {\n",
       "    animation: m2g-blink var(--m2g-trans) 3;\n",
       "}\n",
       "@keyframes m2g-blink {\n",
       "    0% {\n",
       "        opacity: 1;\n",
       "    }\n",
       "    49% {\n",
       "        opacity: 1;\n",
       "    }\n",
       "    50% {\n",
       "        opacity: 0;\n",
       "    }\n",
       "    100% {\n",
       "        opacity: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* Copyable text */\n",
       ".copy-me {\n",
       "    position: relative;\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Modal popup\n",
       " * - - -\n",
       " * Triggered by make_popup_callback()\n",
       " * See https://mols2grid.readthedocs.io/en/latest/notebooks/callbacks.html#Display-a-popup-containing-descriptors\n",
       " */\n",
       "\n",
       "/* Container */\n",
       "#m2g-modal-container {\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "    background: var(--m2g-black-10);\n",
       "    position: fixed;\n",
       "    top: 0;\n",
       "    left: 0;\n",
       "    z-index: 1;\n",
       "    width: 100%;\n",
       "    height: 100%;\n",
       "    \n",
       "    /* Transition */\n",
       "    opacity: 0;\n",
       "    transition: opacity var(--m2g-trans) linear;\n",
       "}\n",
       "\n",
       "/* Modal */\n",
       "#m2g-modal {\n",
       "    background: #fff;\n",
       "    border-radius: var(--m2g-br);\n",
       "    box-shadow: 0 0 30px var(--m2g-black-10);\n",
       "    padding: 20px;\n",
       "    position: relative;\n",
       "    max-width: calc(100% - 80px);\n",
       "    max-height: calc(100% - 80px);\n",
       "    display: flex;\n",
       "    flex-direction: column;\n",
       "    min-width: 26px;\n",
       "\n",
       "    /* Transition */\n",
       "    opacity: 0;\n",
       "    transform: translate(0, 5px);\n",
       "    transition: transform var(--m2g-trans) ease-in-out, opacity var(--m2g-trans) linear;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header {\n",
       "    flex: 0 0 26px;\n",
       "    margin-bottom: 10px;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header h2 {\n",
       "    margin-bottom: 0;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header h2 + p {\n",
       "    font-size: 15px;\n",
       "}\n",
       "#m2g-modal .m2g-modal-body {\n",
       "    flex: 1;\n",
       "    position: relative;\n",
       "}\n",
       "\n",
       "/* Transition */\n",
       "#m2g-modal-container.show {\n",
       "    opacity: 1;\n",
       "}\n",
       "#m2g-modal-container.show #m2g-modal {\n",
       "    opacity: 1;\n",
       "    transform: translate(0, 0);\n",
       "}\n",
       "\n",
       "/* Header + close btn */\n",
       "#m2g-modal h2 {\n",
       "    line-height: 26px;\n",
       "    padding-right: 40px;\n",
       "    text-transform: capitalize;\n",
       "}\n",
       "#m2g-modal h3 {\n",
       "    \n",
       "}\n",
       "#m2g-modal button.close {\n",
       "    background: transparent;\n",
       "    padding: 0;\n",
       "    color: var(--m2g-black);\n",
       "    font-size: 1.5rem;\n",
       "    width: 40px;\n",
       "    height: 40px;\n",
       "    position: absolute;\n",
       "    top: 13px;\n",
       "    right: 13px;\n",
       "    border: none;\n",
       "}\n",
       "\n",
       "/* Image */\n",
       "#m2g-modal .svg-wrap svg {\n",
       "    max-width: 100%;\n",
       "    margin-bottom: 20px;\n",
       "}\n",
       "\n",
       "/* Separator */\n",
       "hr {\n",
       "    width: 100%;\n",
       "    height: 1px;\n",
       "    background: #ddd;\n",
       "    margin: 15px 0;\n",
       "    border: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Hover states\n",
       " */\n",
       "@media (hover:hover) {\n",
       "    /* Pagination */\n",
       "    #mols2grid ul.m2g-pagination li:not(.active):not(.disabled):hover {\n",
       "        background: #f0f0f0;\n",
       "        z-index: 1;\n",
       "    }\n",
       "    #mols2grid ul.m2g-pagination li.active + li:hover {\n",
       "        /* Keeping the hover border consiistent */\n",
       "        margin-left: 1px;\n",
       "        border-left: none;\n",
       "        min-width: 40px;\n",
       "    }\n",
       "\n",
       "    /* Dropdowns &amp; search */\n",
       "    #mols2grid .m2g-dropdown:not(:focus-within):hover,\n",
       "    #mols2grid .m2g-search-wrap:not(:focus-within):hover,\n",
       "    #mols2grid .m2g-sort:not(:focus-within) .m2g-order:hover {\n",
       "        background-color: #f0f0f0;\n",
       "    }\n",
       "    #mols2grid .m2g-search-wrap:not(:focus-within):hover {\n",
       "        background: #fff;\n",
       "        border-color: rgba(0,0,0,.3);\n",
       "    }\n",
       "    /* Hocus pocus to have separate hover states for dropdown and arrow */\n",
       "    #mols2grid .m2g-dropdown.m2g-sort:not(:focus-within):hover .m2g-order:not(:hover) + .m2g-display {\n",
       "        background-color: transparent;\n",
       "    }\n",
       "\n",
       "    /* Search options */\n",
       "    #mols2grid .m2g-search-options .m2g-option:not(.sel):hover {\n",
       "        background: rgba(0,0,0,.15);\n",
       "    }\n",
       "\n",
       "    /* Grid */\n",
       "    /* Note: this is in an ::after pseudo element, so the transparent\n",
       "    hover color plays nice with the cell background color. */\n",
       "    #mols2grid .m2g-cell:hover::after {\n",
       "        content: &#x27;&#x27;;\n",
       "        width: 100%;\n",
       "        height: 100%;\n",
       "        position: absolute;\n",
       "        top: 0;\n",
       "        left: 0;\n",
       "        background-color: rgba(0,0,0,0.05);\n",
       "        pointer-events: none;\n",
       "    }\n",
       "\n",
       "    /* info button */\n",
       "    #mols2grid .m2g-info:hover::before {\n",
       "        content: &#x27;i&#x27;;\n",
       "        color: #fff;\n",
       "        width: 18px;\n",
       "        height: 18px;\n",
       "        line-height: 18px;\n",
       "        background: var(--m2g-hl);\n",
       "        position: absolute;\n",
       "        left: 5px;\n",
       "        top: 5px;\n",
       "        border-radius: 9px;\n",
       "    }\n",
       "    \n",
       "    /* Callback button */\n",
       "    #mols2grid .m2g-callback:hover::after {\n",
       "        background-color: var(--m2g-black);\n",
       "        background-image: var(--m2g-icn-triangle-white);\n",
       "        border-color: transparent;\n",
       "    }\n",
       "\n",
       "    /* Copyable text */\n",
       "    .copy-me:hover {\n",
       "        text-decoration: underline;\n",
       "        text-decoration-color: var(--m2g-blue);\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Responsive behavior.\n",
       " * - - -\n",
       " * Note: container queries won&#x27;t work in older browsers,\n",
       " * but this is purely aesthetical behavior so that&#x27;s ok.\n",
       " * https://caniuse.com/css-container-queries\n",
       " */\n",
       "\n",
       "/* This sets the msg-list div as reference container */\n",
       "#mols2grid {\n",
       "    container-type: inline-size;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Functions section\n",
       " */\n",
       "\n",
       "/* When there&#x27;s not enough space to put everything in one row, we break it into two.\n",
       " * - - -\n",
       " * 870px = pagination 280 + sort 200 + search 300 + menu 40 + (3*10 gap) = 850 + 20 buffer.\n",
       " * Buffer required because the button width inside the search depends on the font.\n",
       " */\n",
       "@container (max-width: 870px) {\n",
       "    #mols2grid .m2g-functions {\n",
       "        flex-direction: column-reverse;\n",
       "        gap: 10px;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-row:last-child {\n",
       "        justify-content: flex-end;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-row:first-child *:last-child {\n",
       "        margin-right: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for pagination + sort on one row,\n",
       " * we reduce the sort drodpwon width.\n",
       " */\n",
       "@container (max-width: 500px) {\n",
       "    #mols2grid .m2g-functions .m2g-sort {\n",
       "        width: 80px;\n",
       "        flex-basis: 80px;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-sort .m2g-display {\n",
       "        font-size: 0;\n",
       "        line-height: 0;\n",
       "        padding-right: 0;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-sort .m2g-display::before {\n",
       "        content: &#x27;Sort&#x27;;\n",
       "        font-size: var(--m2g-fs);\n",
       "        line-height: var(--m2g-h);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for pagination + reduced sort on one row,\n",
       " * we reduce the pagination width.\n",
       " */\n",
       "@container (max-width: 500px) {\n",
       "    /* We&#x27;re overriding min-width from different\n",
       "    locations, including responsive rules */\n",
       "    #mols2grid ul.m2g-pagination li,\n",
       "    #mols2grid ul.m2g-pagination li:last-child,\n",
       "    #mols2grid ul.m2g-pagination li.active + li:hover {\n",
       "        min-width: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for searchbar + menu\n",
       " * we scale down the searchbar to fit the container.\n",
       " */\n",
       "@container (max-width: 370px) {\n",
       "    #mols2grid .m2g-functions .m2g-row .m2g-search-wrap {\n",
       "        flex: 1;\n",
       "    }\n",
       "    #mols2grid .m2g-searchbar {\n",
       "        width: calc(100% - 50px);\n",
       "    }\n",
       "    #mols2grid .m2g-search-options {\n",
       "        width: 50px;\n",
       "    }\n",
       "\n",
       "    /* Collapse options in T/M buttons */\n",
       "    #mols2grid .m2g-search-options .m2g-option {\n",
       "        width: 25px;\n",
       "        text-align: center;\n",
       "        padding: 0;\n",
       "        overflow: hidden;\n",
       "    }\n",
       "    #mols2grid .m2g-search-options .m2g-option:first-child::before {\n",
       "        content: &#x27;T\\A&#x27;\n",
       "    }\n",
       "    #mols2grid .m2g-search-options .m2g-option:last-child::before {\n",
       "        content: &#x27;S\\A&#x27;\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Grid\n",
       " */\n",
       "\n",
       "/* When there&#x27;s room for 5 columns, fall back to 4 */\n",
       "@container (min-width: 519px) and (max-width: 779px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 4);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s room for 7-11 columns, fall back to 6 */\n",
       "@container (min-width: 779px) and (max-width: 1559px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 6);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s room for 13+ columns, fall back to 12 */\n",
       "@container (min-width: 1559px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 12);\n",
       "    }\n",
       "}\n",
       "\n",
       "            /* Custom CSS */\n",
       "            \n",
       "        &lt;/style&gt;\n",
       "        &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js&quot;&gt;&lt;/script&gt;\n",
       "&lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot; integrity=&quot;sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;\n",
       "&lt;script src=&quot;https://unpkg.com/@rdkit/rdkit@2022.3.1/Code/MinimalLib/dist/RDKit_minimal.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script&gt;\n",
       "    // Set iframe height to fit content.\n",
       "    function fitIframe(iframe) {\n",
       "        // Ignore when there&#x27;s no iframe\n",
       "        if (!iframe) return\n",
       "\n",
       "        // Only fit height when no specific height was given.\n",
       "        if (iframe.getAttribute(&#x27;height&#x27;)) return;\n",
       "\n",
       "        // Initial fit + refit whenever the window width changes.\n",
       "        _fit()\n",
       "        $(window).on(&#x27;resize&#x27;, function() {\n",
       "            if (window.innerWidth != window.prevInnerWidth) {\n",
       "                window.prevInnerWidth = window.innerWidth\n",
       "                _fit();\n",
       "            }\n",
       "        })\n",
       "\n",
       "        // Fit iframe height to content height.\n",
       "        function _fit() {\n",
       "            var height = iframe.contentDocument.body.scrollHeight + 18 + &#x27;px&#x27;;\n",
       "            iframe.style.height = height;\n",
       "        }\n",
       "    }\n",
       "&lt;/script&gt;\n",
       "\n",
       "&lt;!-- prettier-ignore --&gt;\n",
       "&lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js&quot; integrity=&quot;sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;\n",
       "        \n",
       "        &lt;!-- Custom header --&gt;\n",
       "        \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "    &lt;/head&gt;\n",
       "    &lt;body class=&quot;m2g-inside-iframe&quot;&gt;\n",
       "\n",
       "\n",
       "\n",
       "        &lt;div id=&quot;mols2grid&quot; class=&quot;grid-default&quot;&gt;\n",
       "            &lt;!-- Pagination &amp; search --&gt;\n",
       "            &lt;div class=&quot;m2g-functions&quot;&gt;\n",
       "                \n",
       "                &lt;div class=&quot;m2g-row&quot;&gt;\n",
       "                    &lt;!-- Pagination --&gt;\n",
       "                    &lt;ul class=&quot;m2g-pagination&quot; class=&quot;d-flex&quot;&gt;&lt;/ul&gt;\n",
       "                    &lt;div class=&quot;m2g-gap&quot;&gt;&lt;/div&gt;\n",
       "\n",
       "                    &lt;!-- Sort dropdown --&gt;\n",
       "                    &lt;div class=&quot;m2g-dropdown m2g-sort&quot;&gt;\n",
       "                        &lt;select&gt;\n",
       "                            \n",
       "                            \n",
       "                                \n",
       "                                \n",
       "                                \n",
       "                            &lt;option value=&quot;mols2grid-id&quot; selected&gt;Index&lt;/option&gt;\n",
       "                                \n",
       "                            \n",
       "                                \n",
       "                                \n",
       "                                \n",
       "                            &lt;option value=&quot;data-Name&quot;&gt;Name&lt;/option&gt;\n",
       "                                \n",
       "                            \n",
       "                            \n",
       "                            &lt;option value=&quot;checkbox&quot;&gt;Selected&lt;/option&gt;\n",
       "                            \n",
       "                        &lt;/select&gt;\n",
       "                        &lt;div class=&quot;m2g-order&quot;&gt;&lt;/div&gt;\n",
       "                        &lt;div class=&quot;m2g-display&quot;&gt;\n",
       "                            Index\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "                &lt;/div&gt;\n",
       "                &lt;div class=&quot;m2g-row&quot;&gt;\n",
       "                    &lt;!-- Search bar --&gt;\n",
       "                    &lt;div class=&quot;m2g-search-wrap&quot;&gt;\n",
       "                        &lt;input\n",
       "                            type=&quot;text&quot;\n",
       "                            class=&quot;m2g-searchbar form-control&quot;\n",
       "                            placeholder=&quot;Search&quot;\n",
       "                            aria-label=&quot;Search&quot;\n",
       "                            aria-describedby=&quot;basic-addon1&quot;\n",
       "                        /&gt;\n",
       "                        &lt;div class=&quot;m2g-search-options&quot;&gt;\n",
       "                            &lt;div class=&quot;m2g-option m2g-search-text sel&quot;&gt;Text&lt;/div&gt;\n",
       "                            &lt;div class=&quot;m2g-option m2g-search-smarts&quot;&gt;SMARTS&lt;/div&gt;\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "\n",
       "                    &lt;!-- Action dropdown --&gt;\n",
       "                    &lt;div class=&quot;m2g-dropdown m2g-actions&quot;&gt;\n",
       "                        &lt;select&gt;\n",
       "                            &lt;option hidden&gt;-&lt;/option&gt;\n",
       "                            &lt;option value=&quot;select-all&quot;&gt;Select all&lt;/option&gt;\n",
       "                            &lt;option value=&quot;select-matching&quot;&gt;Select matching&lt;/option&gt;\n",
       "                            &lt;option value=&quot;unselect-all&quot;&gt;Unselect all&lt;/option&gt;\n",
       "                            &lt;option value=&quot;invert&quot;&gt;Invert&lt;/option&gt;\n",
       "                            &lt;option value=&quot;copy&quot;&gt;Copy to clipboard&lt;/option&gt;\n",
       "                            &lt;option value=&quot;save-smiles&quot;&gt;Save SMILES&lt;/option&gt;\n",
       "                            &lt;option value=&quot;save-csv&quot;&gt;Save CSV&lt;/option&gt;\n",
       "                        &lt;/select&gt;\n",
       "                        &lt;div class=&quot;m2g-icon&quot;&gt;\n",
       "                            &lt;svg width=&quot;20&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;\n",
       "                                &lt;path d=&quot;M11.5 4C11.5 4.82843 10.8284 5.5 10 5.5C9.17157 5.5 8.5 4.82843 8.5 4C8.5 3.17157 9.17157 2.5 10 2.5C10.8284 2.5 11.5 3.17157 11.5 4ZM11.5 10C11.5 10.8284 10.8284 11.5 10 11.5C9.17157 11.5 8.5 10.8284 8.5 10C8.5 9.17157 9.17157 8.5 10 8.5C10.8284 8.5 11.5 9.17157 11.5 10ZM10 17.5C10.8284 17.5 11.5 16.8284 11.5 16C11.5 15.1716 10.8284 14.5 10 14.5C9.17157 14.5 8.5 15.1716 8.5 16C8.5 16.8284 9.17157 17.5 10 17.5Z&quot;/&gt;\n",
       "                            &lt;/svg&gt;\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "                &lt;/div&gt;\n",
       "            &lt;/div&gt;\n",
       "\n",
       "            &lt;!-- Grid --&gt;\n",
       "            \n",
       "            &lt;div class=&quot;m2g-list&quot;&gt;&lt;div class=&quot;m2g-cell&quot; data-mols2grid-id=&quot;0&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;m2g-cb-wrap&quot;&gt;&lt;input type=&quot;checkbox&quot; tabindex=&quot;-1&quot; class=&quot;position-relative float-left cached_checkbox&quot;&gt;&lt;div class=&quot;m2g-cb&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data-mols2grid-id-display&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;m2g-cell-actions&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-img copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-Name copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-SMILES copy-me&quot; style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;\n",
       "        &lt;/div&gt;\n",
       "        &lt;script&gt;\n",
       "            // list.js\n",
       "var listObj = new List(&#x27;mols2grid&#x27;, {\n",
       "    listClass: &#x27;m2g-list&#x27;,\n",
       "    valueNames: [{data: [&#x27;mols2grid-id&#x27;]}, &#x27;data-mols2grid-id&#x27;, &#x27;data-SMILES&#x27;, &#x27;data-img&#x27;, &#x27;data-Name&#x27;, &#x27;data-mols2grid-id-display&#x27;],\n",
       "    item: &#x27;&lt;div class=&quot;m2g-cell&quot; data-mols2grid-id=&quot;0&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;m2g-cb-wrap&quot;&gt;&lt;input type=&quot;checkbox&quot; tabindex=&quot;-1&quot; class=&quot;position-relative float-left cached_checkbox&quot;&gt;&lt;div class=&quot;m2g-cb&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data-mols2grid-id-display&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;m2g-cell-actions&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-img copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-Name copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-SMILES copy-me&quot; style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&#x27;,\n",
       "    page: 24,\n",
       "    pagination: {\n",
       "        paginationClass: &quot;m2g-pagination&quot;,\n",
       "        item: &#x27;&lt;li class=&quot;page-item&quot;&gt;&lt;a class=&quot;page page-link&quot; href=&quot;#&quot; onclick=&quot;event.preventDefault()&quot;&gt;&lt;/a&gt;&lt;/li&gt;&#x27;,\n",
       "        innerWindow: 1,\n",
       "        outerWindow: 1,\n",
       "    },\n",
       "});\n",
       "listObj.remove(&quot;mols2grid-id&quot;, &quot;0&quot;);\n",
       "listObj.add([{&quot;mols2grid-id&quot;: 0, &quot;data-SMILES&quot;: &quot;CN1C(=O)CO[C@H]2CNC[C@@H]21&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95346843, &quot;data-mols2grid-id-display&quot;: 0}, {&quot;mols2grid-id&quot;: 1, &quot;data-SMILES&quot;: &quot;N[S@](=O)C1CS(=O)(=O)C1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 675072173, &quot;data-mols2grid-id-display&quot;: 1}, {&quot;mols2grid-id&quot;: 2, &quot;data-SMILES&quot;: &quot;CNC(=O)c1n[nH]c(N)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19844301, &quot;data-mols2grid-id-display&quot;: 2}, {&quot;mols2grid-id&quot;: 3, &quot;data-SMILES&quot;: &quot;NC1=NC[C@@H](C(=O)O)CN1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 38415755, &quot;data-mols2grid-id-display&quot;: 3}, {&quot;mols2grid-id&quot;: 4, &quot;data-SMILES&quot;: &quot;N=C(N)NC[C@@H](N)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1576365, &quot;data-mols2grid-id-display&quot;: 4}, {&quot;mols2grid-id&quot;: 5, &quot;data-SMILES&quot;: &quot;COCCNC(=O)NCCN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 41167662, &quot;data-mols2grid-id-display&quot;: 5}, {&quot;mols2grid-id&quot;: 6, &quot;data-SMILES&quot;: &quot;NCCOCCOCCN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1651868, &quot;data-mols2grid-id-display&quot;: 6}, {&quot;mols2grid-id&quot;: 7, &quot;data-SMILES&quot;: &quot;NCC1(N)COC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95644286, &quot;data-mols2grid-id-display&quot;: 7}, {&quot;mols2grid-id&quot;: 8, &quot;data-SMILES&quot;: &quot;NC(=O)[C@H]1[C@H]2C=C[C@@H](O2)[C@@H]1N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 242677143, &quot;data-mols2grid-id-display&quot;: 8}, {&quot;mols2grid-id&quot;: 9, &quot;data-SMILES&quot;: &quot;O[C@@H]1CO[C@H]2[C@H]1OC[C@H]2O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4521362, &quot;data-mols2grid-id-display&quot;: 9}, {&quot;mols2grid-id&quot;: 10, &quot;data-SMILES&quot;: &quot;CN1CCOC(CO)(CO)C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 96024984, &quot;data-mols2grid-id-display&quot;: 10}, {&quot;mols2grid-id&quot;: 11, &quot;data-SMILES&quot;: &quot;C#CC[C@@H](N)C(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 78724393, &quot;data-mols2grid-id-display&quot;: 11}, {&quot;mols2grid-id&quot;: 12, &quot;data-SMILES&quot;: &quot;COCCN1CN=C(NC#N)NC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19329625, &quot;data-mols2grid-id-display&quot;: 12}, {&quot;mols2grid-id&quot;: 13, &quot;data-SMILES&quot;: &quot;NC[C@H](O)[C@H](O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2384201, &quot;data-mols2grid-id-display&quot;: 13}, {&quot;mols2grid-id&quot;: 14, &quot;data-SMILES&quot;: &quot;CO[C@H]1OC[C@H](O)[C@H](O)[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1041345, &quot;data-mols2grid-id-display&quot;: 14}, {&quot;mols2grid-id&quot;: 15, &quot;data-SMILES&quot;: &quot;NC(=O)[C@]1(N2CCNCC2)CCOC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 70992702, &quot;data-mols2grid-id-display&quot;: 15}, {&quot;mols2grid-id&quot;: 16, &quot;data-SMILES&quot;: &quot;O=c1[nH]cc(N2CCOCC2)c(=O)[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 55860, &quot;data-mols2grid-id-display&quot;: 16}, {&quot;mols2grid-id&quot;: 17, &quot;data-SMILES&quot;: &quot;NCC(CN)(CN)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34370327, &quot;data-mols2grid-id-display&quot;: 17}, {&quot;mols2grid-id&quot;: 18, &quot;data-SMILES&quot;: &quot;O=C(O)c1cn(CCO)nn1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 36379848, &quot;data-mols2grid-id-display&quot;: 18}, {&quot;mols2grid-id&quot;: 19, &quot;data-SMILES&quot;: &quot;N#CNc1nc(N)nc(N)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 32191040, &quot;data-mols2grid-id-display&quot;: 19}, {&quot;mols2grid-id&quot;: 20, &quot;data-SMILES&quot;: &quot;CCC(=O)C1C(=O)NC(=O)NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 100739101, &quot;data-mols2grid-id-display&quot;: 20}, {&quot;mols2grid-id&quot;: 21, &quot;data-SMILES&quot;: &quot;OC[C@H]1NCC[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 14455330, &quot;data-mols2grid-id-display&quot;: 21}, {&quot;mols2grid-id&quot;: 22, &quot;data-SMILES&quot;: &quot;COC(=O)[C@@H](O)[C@H](O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1682447, &quot;data-mols2grid-id-display&quot;: 22}, {&quot;mols2grid-id&quot;: 23, &quot;data-SMILES&quot;: &quot;N[C@H](CC[C@@H](N)C(=O)O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1603017, &quot;data-mols2grid-id-display&quot;: 23}, {&quot;mols2grid-id&quot;: 24, &quot;data-SMILES&quot;: &quot;CN1C(=O)NC(=O)C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1532166, &quot;data-mols2grid-id-display&quot;: 24}, {&quot;mols2grid-id&quot;: 25, &quot;data-SMILES&quot;: &quot;N[C@@H](C[C@@H](N)C(=O)O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1689056, &quot;data-mols2grid-id-display&quot;: 25}, {&quot;mols2grid-id&quot;: 26, &quot;data-SMILES&quot;: &quot;COS(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95588085, &quot;data-mols2grid-id-display&quot;: 26}, {&quot;mols2grid-id&quot;: 27, &quot;data-SMILES&quot;: &quot;O=C1N[C@@H]2Nc3nonc3N[C@H]2N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3662018, &quot;data-mols2grid-id-display&quot;: 27}, {&quot;mols2grid-id&quot;: 28, &quot;data-SMILES&quot;: &quot;OC[C@@H]1O[C@@H](O)[C@H](CO)O[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 105090729, &quot;data-mols2grid-id-display&quot;: 28}, {&quot;mols2grid-id&quot;: 29, &quot;data-SMILES&quot;: &quot;O=C(O)CN[C@H]1C=CS(=O)(=O)C1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4298576, &quot;data-mols2grid-id-display&quot;: 29}, {&quot;mols2grid-id&quot;: 30, &quot;data-SMILES&quot;: &quot;CC(=O)N[C@@H](O)[C@H](O)NC(C)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3668823, &quot;data-mols2grid-id-display&quot;: 30}, {&quot;mols2grid-id&quot;: 31, &quot;data-SMILES&quot;: &quot;N[C@H]1[C@H](O)[C@@H](O)[C@H](CO)O[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5443821, &quot;data-mols2grid-id-display&quot;: 31}, {&quot;mols2grid-id&quot;: 32, &quot;data-SMILES&quot;: &quot;CC(=O)NCCC(=O)NCCO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 35100900, &quot;data-mols2grid-id-display&quot;: 32}, {&quot;mols2grid-id&quot;: 33, &quot;data-SMILES&quot;: &quot;C[C@H]1O[C@H](O)[C@@H](O)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1532676, &quot;data-mols2grid-id-display&quot;: 33}, {&quot;mols2grid-id&quot;: 34, &quot;data-SMILES&quot;: &quot;COCCOCCNC(=O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 44728718, &quot;data-mols2grid-id-display&quot;: 34}, {&quot;mols2grid-id&quot;: 35, &quot;data-SMILES&quot;: &quot;O=c1[nH]c(=O)[nH]c(=O)[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 18044615, &quot;data-mols2grid-id-display&quot;: 35}, {&quot;mols2grid-id&quot;: 36, &quot;data-SMILES&quot;: &quot;C[C@@H](O)CNc1c[nH]c(=O)[nH]c1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4827211, &quot;data-mols2grid-id-display&quot;: 36}, {&quot;mols2grid-id&quot;: 37, &quot;data-SMILES&quot;: &quot;COC(=O)[C@H](N)CC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 32098738, &quot;data-mols2grid-id-display&quot;: 37}, {&quot;mols2grid-id&quot;: 38, &quot;data-SMILES&quot;: &quot;CS(=O)(=O)CCS(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 44594710, &quot;data-mols2grid-id-display&quot;: 38}, {&quot;mols2grid-id&quot;: 39, &quot;data-SMILES&quot;: &quot;CNCc1nnn[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 42191848, &quot;data-mols2grid-id-display&quot;: 39}, {&quot;mols2grid-id&quot;: 40, &quot;data-SMILES&quot;: &quot;NS(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 238809258, &quot;data-mols2grid-id-display&quot;: 40}, {&quot;mols2grid-id&quot;: 41, &quot;data-SMILES&quot;: &quot;Nc1nc(N)n2c(N)nnc2n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 16889989, &quot;data-mols2grid-id-display&quot;: 41}, {&quot;mols2grid-id&quot;: 42, &quot;data-SMILES&quot;: &quot;NC(=O)C1(C(N)=O)CC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1692815, &quot;data-mols2grid-id-display&quot;: 42}, {&quot;mols2grid-id&quot;: 43, &quot;data-SMILES&quot;: &quot;NC(=O)N[C@@H]1NC(=O)NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1843030, &quot;data-mols2grid-id-display&quot;: 43}, {&quot;mols2grid-id&quot;: 44, &quot;data-SMILES&quot;: &quot;O=C1CC(=O)NC(=S)N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 8727446, &quot;data-mols2grid-id-display&quot;: 44}, {&quot;mols2grid-id&quot;: 45, &quot;data-SMILES&quot;: &quot;O=C(NCCO)C1=NN=CC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5494790, &quot;data-mols2grid-id-display&quot;: 45}, {&quot;mols2grid-id&quot;: 46, &quot;data-SMILES&quot;: &quot;NCC(O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1693258, &quot;data-mols2grid-id-display&quot;: 46}, {&quot;mols2grid-id&quot;: 47, &quot;data-SMILES&quot;: &quot;CC(=O)NCCNc1cn[nH]c(=O)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 11991023, &quot;data-mols2grid-id-display&quot;: 47}, {&quot;mols2grid-id&quot;: 48, &quot;data-SMILES&quot;: &quot;COC[C@H](N)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34426550, &quot;data-mols2grid-id-display&quot;: 48}, {&quot;mols2grid-id&quot;: 49, &quot;data-SMILES&quot;: &quot;N#CNC1=NC(=O)CC(=O)N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5133260, &quot;data-mols2grid-id-display&quot;: 49}, {&quot;mols2grid-id&quot;: 50, &quot;data-SMILES&quot;: &quot;O=C1NCCN[C@]1(O)C(F)(F)F&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4204973, &quot;data-mols2grid-id-display&quot;: 50}, {&quot;mols2grid-id&quot;: 51, &quot;data-SMILES&quot;: &quot;NC(=O)[C@H](O)[C@H]1CCOC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 50976959, &quot;data-mols2grid-id-display&quot;: 51}, {&quot;mols2grid-id&quot;: 52, &quot;data-SMILES&quot;: &quot;N[C@H]1[C@H](O)O[C@H](CO)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3860468, &quot;data-mols2grid-id-display&quot;: 52}, {&quot;mols2grid-id&quot;: 53, &quot;data-SMILES&quot;: &quot;O=C(O)c1nc(=O)[nH]c(=O)[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 13514753, &quot;data-mols2grid-id-display&quot;: 53}, {&quot;mols2grid-id&quot;: 54, &quot;data-SMILES&quot;: &quot;NC(=O)CN1CCOCC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 20436848, &quot;data-mols2grid-id-display&quot;: 54}, {&quot;mols2grid-id&quot;: 55, &quot;data-SMILES&quot;: &quot;N#CNC1=NCN(CCO)CN1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19330782, &quot;data-mols2grid-id-display&quot;: 55}, {&quot;mols2grid-id&quot;: 56, &quot;data-SMILES&quot;: &quot;O=C(O)CNC(=O)CC(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 45285524, &quot;data-mols2grid-id-display&quot;: 56}, {&quot;mols2grid-id&quot;: 57, &quot;data-SMILES&quot;: &quot;CO[C@@H]1[C@H](O)[C@H](C)O[C@H](CO)[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 166514298, &quot;data-mols2grid-id-display&quot;: 57}, {&quot;mols2grid-id&quot;: 58, &quot;data-SMILES&quot;: &quot;N#CNC(=N)N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5112486, &quot;data-mols2grid-id-display&quot;: 58}, {&quot;mols2grid-id&quot;: 59, &quot;data-SMILES&quot;: &quot;O=C(c1c[nH]c(=O)[nH]1)N1CCNCC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 20258057, &quot;data-mols2grid-id-display&quot;: 59}, {&quot;mols2grid-id&quot;: 60, &quot;data-SMILES&quot;: &quot;O=C(O)C12CNCC1CNC2&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 306937672, &quot;data-mols2grid-id-display&quot;: 60}, {&quot;mols2grid-id&quot;: 61, &quot;data-SMILES&quot;: &quot;NCc1cc(=O)[nH]c(O)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 26507110, &quot;data-mols2grid-id-display&quot;: 61}, {&quot;mols2grid-id&quot;: 62, &quot;data-SMILES&quot;: &quot;O[C@@H]1[C@@H](O)[C@H]2[C@@H](O)CCN2C[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 247855053, &quot;data-mols2grid-id-display&quot;: 62}, {&quot;mols2grid-id&quot;: 63, &quot;data-SMILES&quot;: &quot;C[C@H](O)[C@H](O)[C@H](O)[C@@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 137815004, &quot;data-mols2grid-id-display&quot;: 63}, {&quot;mols2grid-id&quot;: 64, &quot;data-SMILES&quot;: &quot;N#CN(CCO)CCO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 62715247, &quot;data-mols2grid-id-display&quot;: 64}, {&quot;mols2grid-id&quot;: 65, &quot;data-SMILES&quot;: &quot;N#C[C@H]1CS(=O)(=O)C[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 68985053, &quot;data-mols2grid-id-display&quot;: 65}, {&quot;mols2grid-id&quot;: 66, &quot;data-SMILES&quot;: &quot;C[S@@](=O)CC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34310585, &quot;data-mols2grid-id-display&quot;: 66}, {&quot;mols2grid-id&quot;: 67, &quot;data-SMILES&quot;: &quot;COC[C@@H](O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2263862, &quot;data-mols2grid-id-display&quot;: 67}, {&quot;mols2grid-id&quot;: 68, &quot;data-SMILES&quot;: &quot;CN1C(=O)[C@@H]2CNCCN2C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 72314731, &quot;data-mols2grid-id-display&quot;: 68}, {&quot;mols2grid-id&quot;: 69, &quot;data-SMILES&quot;: &quot;CN(C)CCN(C)S(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 98210169, &quot;data-mols2grid-id-display&quot;: 69}, {&quot;mols2grid-id&quot;: 70, &quot;data-SMILES&quot;: &quot;CS(=O)(=O)NC1CNC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 83119925, &quot;data-mols2grid-id-display&quot;: 70}, {&quot;mols2grid-id&quot;: 71, &quot;data-SMILES&quot;: &quot;CN(C)S(=O)(=O)NC#N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5524996, &quot;data-mols2grid-id-display&quot;: 71}, {&quot;mols2grid-id&quot;: 72, &quot;data-SMILES&quot;: &quot;N#CN(CS(=O)(=O)O)C(=N)N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4411341, &quot;data-mols2grid-id-display&quot;: 72}, {&quot;mols2grid-id&quot;: 73, &quot;data-SMILES&quot;: &quot;CO[C@@H]1O[C@H](C)[C@H](O)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 43505237, &quot;data-mols2grid-id-display&quot;: 73}, {&quot;mols2grid-id&quot;: 74, &quot;data-SMILES&quot;: &quot;Cn1ncc2c(=O)[nH]c(NN)nc21&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 16969122, &quot;data-mols2grid-id-display&quot;: 74}, {&quot;mols2grid-id&quot;: 75, &quot;data-SMILES&quot;: &quot;CN1C(=O)[C@@H]2CNC[C@H]2C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 105580712, &quot;data-mols2grid-id-display&quot;: 75}, {&quot;mols2grid-id&quot;: 76, &quot;data-SMILES&quot;: &quot;O[C@@H]1[C@@H]2O[C@H]2[C@@H](O)[C@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 253639163, &quot;data-mols2grid-id-display&quot;: 76}, {&quot;mols2grid-id&quot;: 77, &quot;data-SMILES&quot;: &quot;N[C@@H]1N=CC=NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 39778426, &quot;data-mols2grid-id-display&quot;: 77}, {&quot;mols2grid-id&quot;: 78, &quot;data-SMILES&quot;: &quot;NC(=O)[C@H](N)[C@@H]1CCOC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 37870616, &quot;data-mols2grid-id-display&quot;: 78}, {&quot;mols2grid-id&quot;: 79, &quot;data-SMILES&quot;: &quot;C[C@H](O)[C@@H](O)[C@@H](O)[C@H](O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 901090, &quot;data-mols2grid-id-display&quot;: 79}, {&quot;mols2grid-id&quot;: 80, &quot;data-SMILES&quot;: &quot;O=C1N[C@@H]2NC(=O)N(CCO)[C@H]2N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2251996, &quot;data-mols2grid-id-display&quot;: 80}, {&quot;mols2grid-id&quot;: 81, &quot;data-SMILES&quot;: &quot;O=S1(=O)NCCO1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95708091, &quot;data-mols2grid-id-display&quot;: 81}, {&quot;mols2grid-id&quot;: 82, &quot;data-SMILES&quot;: &quot;NNc1n[nH]c(=S)n1N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 12958520, &quot;data-mols2grid-id-display&quot;: 82}, {&quot;mols2grid-id&quot;: 83, &quot;data-SMILES&quot;: &quot;O=C(CO)[C@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 901232, &quot;data-mols2grid-id-display&quot;: 83}, {&quot;mols2grid-id&quot;: 84, &quot;data-SMILES&quot;: &quot;O=C(O)C(=O)C[C@@H](O)[C@@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1532571, &quot;data-mols2grid-id-display&quot;: 84}, {&quot;mols2grid-id&quot;: 85, &quot;data-SMILES&quot;: &quot;NCC(=O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1558643, &quot;data-mols2grid-id-display&quot;: 85}, {&quot;mols2grid-id&quot;: 86, &quot;data-SMILES&quot;: &quot;C[C@H](N)C(=O)N[C@H](C)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1575495, &quot;data-mols2grid-id-display&quot;: 86}, {&quot;mols2grid-id&quot;: 87, &quot;data-SMILES&quot;: &quot;NC(=O)CCNC(=O)CCC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 57218621, &quot;data-mols2grid-id-display&quot;: 87}, {&quot;mols2grid-id&quot;: 88, &quot;data-SMILES&quot;: &quot;C[C@]1(CN)NC(=O)NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 39401552, &quot;data-mols2grid-id-display&quot;: 88}, {&quot;mols2grid-id&quot;: 89, &quot;data-SMILES&quot;: &quot;O=C1CNC(=S)N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1089842, &quot;data-mols2grid-id-display&quot;: 89}, {&quot;mols2grid-id&quot;: 90, &quot;data-SMILES&quot;: &quot;O=C(CO)[C@@H](O)[C@@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 902219, &quot;data-mols2grid-id-display&quot;: 90}, {&quot;mols2grid-id&quot;: 91, &quot;data-SMILES&quot;: &quot;CC(C)NC(=O)[C@@H](N)CC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34770001, &quot;data-mols2grid-id-display&quot;: 91}, {&quot;mols2grid-id&quot;: 92, &quot;data-SMILES&quot;: &quot;COC[C@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2504425, &quot;data-mols2grid-id-display&quot;: 92}, {&quot;mols2grid-id&quot;: 93, &quot;data-SMILES&quot;: &quot;CO[C@H]1OC[C@@H](O)[C@H](O)[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4371221, &quot;data-mols2grid-id-display&quot;: 93}, {&quot;mols2grid-id&quot;: 94, &quot;data-SMILES&quot;: &quot;NC(=O)CN1CCC(N)CC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 9256947, &quot;data-mols2grid-id-display&quot;: 94}, {&quot;mols2grid-id&quot;: 95, &quot;data-SMILES&quot;: &quot;CNC(=S)NC(=N)N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 33691246, &quot;data-mols2grid-id-display&quot;: 95}, {&quot;mols2grid-id&quot;: 96, &quot;data-SMILES&quot;: &quot;N=C(N)CN1CC[C@H](O)C1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 203414649, &quot;data-mols2grid-id-display&quot;: 96}, {&quot;mols2grid-id&quot;: 97, &quot;data-SMILES&quot;: &quot;N=C(N)[C@@H](NC=O)C(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 66370807, &quot;data-mols2grid-id-display&quot;: 97}, {&quot;mols2grid-id&quot;: 98, &quot;data-SMILES&quot;: &quot;NS(=O)(=O)NC1CCOCC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 160854167, &quot;data-mols2grid-id-display&quot;: 98}, {&quot;mols2grid-id&quot;: 99, &quot;data-SMILES&quot;: &quot;O=C1N[C@@H](CO)C(=O)N2CCC[C@@H]12&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5374243, &quot;data-mols2grid-id-display&quot;: 99}, {&quot;mols2grid-id&quot;: 100, &quot;data-SMILES&quot;: &quot;O=C1O[C@@H]2C[C@@]1(O)C[C@H](O)[C@@H]2O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 71786849, &quot;data-mols2grid-id-display&quot;: 100}, {&quot;mols2grid-id&quot;: 101, &quot;data-SMILES&quot;: &quot;O=C1O[C@H](CO)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3861798, &quot;data-mols2grid-id-display&quot;: 101}, {&quot;mols2grid-id&quot;: 102, &quot;data-SMILES&quot;: &quot;NC(=O)N1C[C@H](O)C[C@H]1C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3257688, &quot;data-mols2grid-id-display&quot;: 102}, {&quot;mols2grid-id&quot;: 103, &quot;data-SMILES&quot;: &quot;O=C(O)C(=O)CS(=O)(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4096823, &quot;data-mols2grid-id-display&quot;: 103}, {&quot;mols2grid-id&quot;: 104, &quot;data-SMILES&quot;: &quot;NCCNC(=O)[C@@H]1CCCNC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2570758, &quot;data-mols2grid-id-display&quot;: 104}, {&quot;mols2grid-id&quot;: 105, &quot;data-SMILES&quot;: &quot;NCCc1nnc2c(=O)[nH]ccn12&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 409423317, &quot;data-mols2grid-id-display&quot;: 105}, {&quot;mols2grid-id&quot;: 106, &quot;data-SMILES&quot;: &quot;OC[C@H]1O[C@H](O)[C@@H](F)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 44154413, &quot;data-mols2grid-id-display&quot;: 106}, {&quot;mols2grid-id&quot;: 107, &quot;data-SMILES&quot;: &quot;NCCS(=O)(=O)CCO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 38251012, &quot;data-mols2grid-id-display&quot;: 107}, {&quot;mols2grid-id&quot;: 108, &quot;data-SMILES&quot;: &quot;NS(=O)(=O)NC[C@@H]1CCCNC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19503746, &quot;data-mols2grid-id-display&quot;: 108}, {&quot;mols2grid-id&quot;: 109, &quot;data-SMILES&quot;: &quot;NC(=O)NC(CO)(CO)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1283225, &quot;data-mols2grid-id-display&quot;: 109}]);\n",
       "\n",
       "\n",
       "// filter\n",
       "if (window.parent.mols2grid_lists === undefined) {\n",
       "    window.parent.mols2grid_lists = {};\n",
       "}\n",
       "window.parent.mols2grid_lists[&quot;default&quot;] = listObj;\n",
       "\n",
       "\n",
       "// selection\n",
       "class MolStorage extends Map {\n",
       "    multi_set(_id, _smiles) {\n",
       "        for (let i = 0; i &lt; _id.length; i++) {\n",
       "            this.set(_id[i], _smiles[i])\n",
       "        }\n",
       "    }\n",
       "    multi_del(_id) {\n",
       "        for (let i = 0; i &lt; _id.length; i++) {\n",
       "            this.delete(_id[i])\n",
       "        }\n",
       "    }\n",
       "    to_dict() {\n",
       "        var content = &#x27;{&#x27;\n",
       "        for (let [key, value] of this) {\n",
       "            content += key + &#x27;:&#x27; + JSON.stringify(value) + &#x27;,&#x27;\n",
       "        }\n",
       "        content = content.length &gt; 1 ? content.slice(0, -1) : content\n",
       "        content += &#x27;}&#x27;\n",
       "        return content\n",
       "    }\n",
       "    to_keys() {\n",
       "        var content = []\n",
       "        for (let [key] of this) {\n",
       "            content.push(key)\n",
       "        }\n",
       "        return content\n",
       "    }\n",
       "    download_smi(fileName, allItems) {\n",
       "        var content = &#x27;&#x27;\n",
       "\n",
       "        if (allItems) {\n",
       "            // Gather all smiles\n",
       "            for (var item of allItems) {\n",
       "                var smiles = item.values()[&#x27;data-SMILES&#x27;]\n",
       "                var id = item.values()[&#x27;mols2grid-id&#x27;]\n",
       "                content += smiles + &#x27; &#x27; + id + &#x27;\\n&#x27;\n",
       "            }\n",
       "        } else {\n",
       "            // Gather selected smiles\n",
       "            for (let [key, value] of this) {\n",
       "                content += value + &#x27; &#x27; + key + &#x27;\\n&#x27;\n",
       "            }\n",
       "        }\n",
       "\n",
       "        var a = document.createElement(&#x27;a&#x27;)\n",
       "        var file = new Blob([content], { type: &#x27;text/plain&#x27; })\n",
       "        a.href = URL.createObjectURL(file)\n",
       "        a.download = fileName\n",
       "        a.click()\n",
       "        a.remove()\n",
       "    }\n",
       "}\n",
       "var SELECTION = new MolStorage();\n",
       "\n",
       "\n",
       "\n",
       "// kernel\n",
       "function add_selection(grid_id, _id, smiles) {\n",
       "    SELECTION.multi_set(_id, smiles);\n",
       "    let model = window.parent[&quot;_MOLS2GRID_&quot; + grid_id];\n",
       "    if (model) {\n",
       "        model.set(&quot;selection&quot;, SELECTION.to_dict());\n",
       "        model.save_changes();\n",
       "    }\n",
       "}\n",
       "function del_selection(grid_id, _id) {\n",
       "    SELECTION.multi_del(_id);\n",
       "    let model = window.parent[&quot;_MOLS2GRID_&quot; + grid_id];\n",
       "    if (model) {\n",
       "        model.set(&quot;selection&quot;, SELECTION.to_dict());\n",
       "        model.save_changes();\n",
       "    }\n",
       "}\n",
       "if (window.parent.IPython !== undefined) {\n",
       "    // Jupyter notebook\n",
       "    var kernel_env = &quot;jupyter&quot;;\n",
       "} else if (window.parent.google !== undefined) {\n",
       "    // Google colab\n",
       "    var kernel_env = &quot;colab&quot;;\n",
       "} else {\n",
       "    var kernel_env = null;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "// sort\n",
       "var sortField = &#x27;mols2grid-id&#x27;\n",
       "var sortOrder = &#x27;asc&#x27;\n",
       "\n",
       "// Sort dropdown\n",
       "$(&#x27;#mols2grid .m2g-sort select&#x27;).change(sort)\n",
       "\n",
       "// Sort order\n",
       "$(&#x27;#mols2grid .m2g-order&#x27;).click(flipSort)\n",
       "\n",
       "function sort(e) {\n",
       "    if (e) {\n",
       "        sortField = e.target.value\n",
       "        var selectedOption = e.target.options[e.target.selectedIndex]\n",
       "        var sortFieldDisplay = selectedOption.text\n",
       "    }\n",
       "\n",
       "    // Sort\n",
       "    if (sortField == &#x27;checkbox&#x27;) {\n",
       "        listObj.sort(&#x27;mols2grid-id&#x27;, {order: sortOrder, sortFunction: checkboxSort})\n",
       "    } else {\n",
       "        listObj.sort(sortField, {order: sortOrder, sortFunction: mols2gridSortFunction})\n",
       "    }\n",
       "\n",
       "    // Update UI.\n",
       "    $(this).parent().find(&#x27;.m2g-display&#x27;).text(sortFieldDisplay)\n",
       "}\n",
       "\n",
       "// prettier-ignore\n",
       "function flipSort() {\n",
       "    $(this).parent().removeClass(&#x27;m2d-arrow-&#x27; + sortOrder)\n",
       "    sortOrder = sortOrder === &#x27;desc&#x27; ? &#x27;asc&#x27; : &#x27;desc&#x27;\n",
       "    $(this).parent().addClass(&#x27;m2d-arrow-&#x27; + sortOrder)\n",
       "    sort()\n",
       "}\n",
       "\n",
       "function mols2gridSortFunction(itemA, itemB, options) {\n",
       "    var x = itemA.values()[options.valueName]\n",
       "    var y = itemB.values()[options.valueName]\n",
       "    if (typeof x === &#x27;number&#x27;) {\n",
       "        if (isFinite(x - y)) {\n",
       "            return x - y\n",
       "        } else {\n",
       "            return isFinite(x) ? -1 : 1\n",
       "        }\n",
       "    } else {\n",
       "        x = x ? x.toLowerCase() : x\n",
       "        y = y ? y.toLowerCase() : y\n",
       "        return x &lt; y ? -1 : x &gt; y ? 1 : 0\n",
       "    }\n",
       "}\n",
       "function checkboxSort(itemA, itemB, options) {\n",
       "    if (itemA.elm !== undefined) {\n",
       "        var checkedA = itemA.elm.querySelector(&#x27;input[type=checkbox]&#x27;).checked\n",
       "        if (itemB.elm !== undefined) {\n",
       "            var checkedB = itemB.elm.querySelector(&#x27;input[type=checkbox]&#x27;).checked\n",
       "            if (checkedA &amp;&amp; !checkedB) {\n",
       "                return -1\n",
       "            } else if (!checkedA &amp;&amp; checkedB) {\n",
       "                return 1\n",
       "            } else {\n",
       "                return 0\n",
       "            }\n",
       "        } else {\n",
       "            return -1\n",
       "        }\n",
       "    } else if (itemB.elm !== undefined) {\n",
       "        return 1\n",
       "    } else {\n",
       "        return 0\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "// grid interactions (select, click, tooltip, key events)\n",
       "// Check if selection UI is supported.\n",
       "var supportSelection = eval(&#x27;True&#x27;.toLowerCase());\n",
       "\n",
       "listObj.on(&quot;updated&quot;, initInteraction);\n",
       "\n",
       "// (Re)initialiuze all grid interaction every time the grid changes.\n",
       "function initInteraction(list) {\n",
       "    initCellClick()\n",
       "    initToolTip()\n",
       "    initKeyboard()\n",
       "    if (supportSelection) initCheckbox()\n",
       "\n",
       "\n",
       "    // Hide pagination if there is only one page.\n",
       "    if (listObj.matchingItems.length &lt;= listObj.page) {\n",
       "        $(&#x27;#mols2grid .m2g-pagination&#x27;).hide()\n",
       "    } else {\n",
       "        $(&#x27;#mols2grid .m2g-pagination&#x27;).show()\n",
       "    }\n",
       "\n",
       "    // Add a bunch of phantom cells.\n",
       "    // These are used as filler to make sure that\n",
       "    // no grid cells need to be resized when there&#x27;s\n",
       "    // not enough results to fill the row.\n",
       "    $(&#x27;#mols2grid .m2g-list&#x27;).append(&#x27;&lt;div class=&quot;m2g-cell m2g-phantom&quot;&gt;&lt;/div&gt;&#x27;.repeat(11));\n",
       "}\n",
       "\n",
       "// Cell click handler.\n",
       "function initCellClick() {\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;click&#x27;).click(function(e) {\n",
       "        if ($(e.target).hasClass(&#x27;m2g-info&#x27;) || $(e.target).is(&#x27;:checkbox&#x27;)) {\n",
       "            // Info button / Checkbox --&gt; do nothing.\n",
       "        } else if ($(e.target).is(&#x27;div&#x27;) &amp;&amp; $(e.target).hasClass(&#x27;data&#x27;)) {\n",
       "            // Data string --&gt; copy text.\n",
       "            copyOnClick(e.target)\n",
       "        } else if ($(e.target).hasClass(&#x27;m2g-callback&#x27;)) {\n",
       "            // Callback button.\n",
       "            onCallbackButtonClick(e.target)\n",
       "        } else {\n",
       "            // Outside checkbox --&gt; toggle the checkbox.\n",
       "            if (supportSelection) {\n",
       "                var chkbox = $(this).find(&#x27;input:checkbox&#x27;)[0]\n",
       "                chkbox.checked = !chkbox.checked\n",
       "                $(chkbox).trigger(&#x27;change&#x27;)\n",
       "            }\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Store an element&#x27;s text content in the clipboard.\n",
       "function copyOnClick(target) {\n",
       "    var text = $(target).text()\n",
       "    navigator.clipboard.writeText(text)\n",
       "\n",
       "    // Blink the cell to indicate that the text was copied.\n",
       "    $(target).addClass(&#x27;m2g-copy-blink&#x27;)\n",
       "    setTimeout(function() {\n",
       "        $(target).removeClass(&#x27;m2g-copy-blink&#x27;)\n",
       "    }, 450)\n",
       "}\n",
       "\n",
       "// Keyboard actions.\n",
       "function initKeyboard() {\n",
       "    // Disable scroll when pressing UP/DOWN arrows\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;keydown&#x27;).keydown(function(e) {\n",
       "        if (e.which == 38 || e.which == 40) {\n",
       "            e.preventDefault()\n",
       "        }\n",
       "    })\n",
       "\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;keyup&#x27;).keyup(function(e) {\n",
       "        var chkbox = $(this).find(&#x27;input:checkbox&#x27;)[0]\n",
       "        if (e.which == 13) {\n",
       "            // ENTER: toggle\n",
       "            chkbox.checked = !chkbox.checked\n",
       "            $(chkbox).trigger(&#x27;change&#x27;)\n",
       "        } else if (e.which == 27 || e.which == 8) {\n",
       "            // ESC/BACKSPACE: unselect\n",
       "            chkbox.checked = false\n",
       "            $(chkbox).trigger(&#x27;change&#x27;)\n",
       "        } else if (e.which == 37) {\n",
       "            // LEFT\n",
       "            $(this).prev().focus()\n",
       "        } else if (e.which == 39) {\n",
       "            // RIGHT\n",
       "            $(this).next().focus()\n",
       "        } else if (e.which == 38 || e.which == 40) {\n",
       "            var containerWidth = $(this).parent().outerWidth()\n",
       "            var cellWidth = $(this).outerWidth() + parseInt($(this).css(&#x27;marginLeft&#x27;)) * 2\n",
       "            var columns = Math.round(containerWidth / cellWidth)\n",
       "            var index = $(this).index()\n",
       "            if (e.which == 38) {\n",
       "                // UP\n",
       "                var indexAbove = Math.max(index - columns, 0)\n",
       "                $(this).parent().children().eq(indexAbove).focus()\n",
       "            } else if (e.which == 40) {\n",
       "                // DOWN    \n",
       "                var total = $(this).parent().children().length\n",
       "                var indexBelow = Math.min(index + columns, total)\n",
       "                $(this).parent().children().eq(indexBelow).focus()\n",
       "            }\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Show tooltip when hovering the info icon.\n",
       "function initToolTip() {\n",
       "    $(&#x27;#mols2grid .m2g-info&#x27;).off(&#x27;mouseenter&#x27;).off(&#x27;mouseleave&#x27;).off(&#x27;click&#x27;).mouseenter(function() {\n",
       "        // Show on enter\n",
       "        $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;show&#x27;)\n",
       "        $(&#x27;body &gt; .popover&#x27;).click(function(e) {\n",
       "            if ($(e.target).hasClass(&#x27;copy-me&#x27;)) {\n",
       "                copyOnClick(e.target)\n",
       "            } else if ($(e.target).is(&#x27;button&#x27;)) {\n",
       "                \n",
       "            }\n",
       "        })\n",
       "    }).mouseleave(function() {\n",
       "        // Hide on leave, unless sticky.\n",
       "        if (!$(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;hide&#x27;)\n",
       "        }\n",
       "    }).click(function() {\n",
       "        // Toggle sticky on click.\n",
       "        $(this).closest(&#x27;.m2g-cell&#x27;).toggleClass(&#x27;m2g-keep-tooltip&#x27;)\n",
       "\n",
       "        // Hide tooltip when sticky was turned off.\n",
       "        if ($(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;show&#x27;)\n",
       "        } else if (!$(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;hide&#x27;)\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Update selection on checkbox click.\n",
       "function initCheckbox() {\n",
       "    $(&quot;input:checkbox&quot;).off(&#x27;change&#x27;).change(function() {\n",
       "        var _id = parseInt($(this).closest(&quot;.m2g-cell&quot;).attr(&quot;data-mols2grid-id&quot;));\n",
       "        if (this.checked) {\n",
       "            var _smiles = $($(this).closest(&quot;.m2g-cell&quot;).children(&quot;.data-SMILES&quot;)[0]).text();\n",
       "            add_selection(&quot;default&quot;, [_id], [_smiles]);\n",
       "        } else {\n",
       "            del_selection(&quot;default&quot;, [_id]);\n",
       "        }\n",
       "    });\n",
       "}\n",
       "\n",
       "// Callback button\n",
       "function onCallbackButtonClick(target) {\n",
       "    var data = {}\n",
       "    data[&quot;mols2grid-id&quot;] = parseInt($(target).closest(&quot;.m2g-cell&quot;)\n",
       "                                            .attr(&quot;data-mols2grid-id&quot;));\n",
       "    data[&quot;img&quot;] = $(target).parent().siblings(&quot;.data-img&quot;).eq(0).get(0).innerHTML;\n",
       "    $(target).parent().siblings(&quot;.data&quot;).not(&quot;.data-img&quot;).each(function() {\n",
       "        let name = this.className.split(&quot; &quot;)\n",
       "            .filter(cls =&gt; cls.startsWith(&quot;data-&quot;))[0]\n",
       "            .substring(5);\n",
       "        data[name] = this.innerHTML;\n",
       "    });\n",
       "\n",
       "    \n",
       "    // Call custom js callback.\n",
       "    None\n",
       "    \n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Actions\n",
       " */\n",
       "\n",
       "// Listen to action dropdown.\n",
       "$(&#x27;#mols2grid .m2g-actions select&#x27;).change(function(e) {\n",
       "    var val = e.target.value\n",
       "    switch(val) {\n",
       "        case &#x27;select-all&#x27;:\n",
       "            selectAll()\n",
       "            break\n",
       "        case &#x27;select-matching&#x27;:\n",
       "            selectMatching()\n",
       "            break\n",
       "        case &#x27;unselect-all&#x27;:\n",
       "            unselectAll()\n",
       "            break\n",
       "        case &#x27;invert&#x27;:\n",
       "            invertSelection()\n",
       "            break\n",
       "        case &#x27;copy&#x27;:\n",
       "            copy()\n",
       "            break\n",
       "        case &#x27;save-smiles&#x27;:\n",
       "            saveSmiles()\n",
       "            break\n",
       "        case &#x27;save-csv&#x27;:\n",
       "            saveCSV()\n",
       "            break\n",
       "    }\n",
       "    $(this).val(&#x27;&#x27;) // Reset dropdown\n",
       "})\n",
       "\n",
       "// Check all.\n",
       "function selectAll(e) {\n",
       "    var _id = [];\n",
       "    var _smiles = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "    });\n",
       "    add_selection(&quot;default&quot;, _id, _smiles);\n",
       "};\n",
       "\n",
       "\n",
       "// Check matching.\n",
       "function selectMatching(e) {\n",
       "    var _id = [];\n",
       "    var _smiles = [];\n",
       "    listObj.matchingItems.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "    });\n",
       "    add_selection(&quot;default&quot;, _id, _smiles);\n",
       "};\n",
       "\n",
       "// Uncheck all.\n",
       "function unselectAll(e) {\n",
       "    var _id = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = false;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = false;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "    });\n",
       "    del_selection(&quot;default&quot;, _id);\n",
       "};\n",
       "\n",
       "// Invert selection.\n",
       "function invertSelection(e) {\n",
       "    var _id_add = [];\n",
       "    var _id_del = [];\n",
       "    var _smiles = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            var chkbox = item.elm.getElementsByTagName(&quot;input&quot;)[0]\n",
       "            chkbox.checked = !chkbox.checked;\n",
       "        } else {\n",
       "            item.show()\n",
       "            var chkbox = item.elm.getElementsByTagName(&quot;input&quot;)[0]\n",
       "            chkbox.checked = !chkbox.checked;\n",
       "            item.hide()\n",
       "        }\n",
       "        if (chkbox.checked) {\n",
       "            _id_add.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "            _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "        } else {\n",
       "            _id_del.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        }\n",
       "    });\n",
       "    del_selection(&quot;default&quot;, _id_del);\n",
       "    add_selection(&quot;default&quot;, _id_add, _smiles);\n",
       "};\n",
       "\n",
       "// Copy to clipboard.\n",
       "function copy(e) {\n",
       "    // navigator.clipboard.writeText(SELECTION.to_dict());\n",
       "    content = _renderCSV(&#x27;\\t&#x27;)\n",
       "    navigator.clipboard.writeText(content)\n",
       "};\n",
       "\n",
       "// Export smiles.\n",
       "function saveSmiles(e) {\n",
       "    var fileName = &quot;selection.smi&quot;\n",
       "    if (SELECTION.size) {\n",
       "        // Download selected smiles\n",
       "        SELECTION.download_smi(fileName);\n",
       "    } else {\n",
       "        // Download all smiles\n",
       "        SELECTION.download_smi(fileName, listObj.items);\n",
       "    }\n",
       "};\n",
       "\n",
       "// Export CSV.\n",
       "function saveCSV(e) {\n",
       "    content = _renderCSV(&#x27;;&#x27;)\n",
       "    var a = document.createElement(&quot;a&quot;);\n",
       "    var file = new Blob([content], {type: &quot;text/csv&quot;});\n",
       "    a.href = URL.createObjectURL(file);\n",
       "    a.download = &quot;selection.csv&quot;;\n",
       "    a.click();\n",
       "    a.remove();\n",
       "};\n",
       "\n",
       "// Render CSV for export of clipboard.\n",
       "function _renderCSV(sep) {\n",
       "    // Same order as subset + tooltip\n",
       "    var columns = Array.from(listObj.items[0].elm.querySelectorAll(&quot;div.data&quot;))\n",
       "        .map(elm =&gt; elm.classList[1])\n",
       "        .filter(name =&gt; name !== &quot;data-img&quot;);\n",
       "    // Remove &#x27;data-&#x27; and img\n",
       "    var header = columns.map(name =&gt; name.slice(5));\n",
       "    // CSV content\n",
       "    header = [&quot;index&quot;].concat(header).join(sep);\n",
       "    var content = header + &quot;\\n&quot;;\n",
       "    listObj.items.forEach(function (item) {\n",
       "        let data = item.values();\n",
       "        let index = data[&quot;mols2grid-id&quot;];\n",
       "        if (SELECTION.has(index) || SELECTION.size === 0) {\n",
       "            content += index;\n",
       "            columns.forEach((key) =&gt; {\n",
       "                content += sep + data[key];\n",
       "            })\n",
       "            content += &quot;\\n&quot;;\n",
       "        }\n",
       "    });\n",
       "    return content\n",
       "}\n",
       "\n",
       "\n",
       "// generate images for the currently displayed molecules\n",
       "var draw_opts = {&quot;width&quot;: 130, &quot;height&quot;: 90};\n",
       "var json_draw_opts = JSON.stringify(draw_opts);\n",
       "\n",
       "var smarts_matches = {};\n",
       "\n",
       "// Load RDKit\n",
       "window\n",
       ".initRDKitModule()\n",
       ".then(function(RDKit) {\n",
       "    console.log(&#x27;RDKit version: &#x27;, RDKit.version());\n",
       "    window.RDKit = RDKit;\n",
       "    window.RDKitModule = RDKit;\n",
       "\n",
       "    // Searchbar\n",
       "    function SmartsSearch(query, columns) {\n",
       "    var smiles_col = columns[0];\n",
       "    smarts_matches = {};\n",
       "    var query = $(&#x27;#mols2grid .m2g-searchbar&#x27;).val();\n",
       "    var qmol = RDKit.get_qmol(query);\n",
       "    if (qmol.is_valid()) {\n",
       "        listObj.items.forEach(function (item) {\n",
       "            var smiles = item.values()[smiles_col]\n",
       "            var mol = RDKit.get_mol(smiles, &#x27;{&quot;removeHs&quot;: false }&#x27;);\n",
       "            if (mol.is_valid()) {\n",
       "                var results = mol.get_substruct_matches(qmol);\n",
       "                if (results === &quot;\\{\\}&quot;) {\n",
       "                    item.found = false;\n",
       "                } else {\n",
       "                    item.found = true;\n",
       "                    \n",
       "                    results = JSON.parse(results);\n",
       "                    \n",
       "                    var highlights = {&quot;atoms&quot;: [], &quot;bonds&quot;: []};\n",
       "                    results.forEach(function (match) {\n",
       "                        highlights[&quot;atoms&quot;].push(...match.atoms)\n",
       "                        highlights[&quot;bonds&quot;].push(...match.bonds)\n",
       "                    });\n",
       "                    \n",
       "                    var index = item.values()[&quot;mols2grid-id&quot;];\n",
       "                    smarts_matches[index] = highlights;\n",
       "                    \n",
       "                }\n",
       "            } else {\n",
       "                item.found = false;\n",
       "            }\n",
       "            mol.delete();\n",
       "        });\n",
       "    }\n",
       "    qmol.delete();\n",
       "}\n",
       "var search_type = &quot;Text&quot;;\n",
       "// Temporary fix for regex characters being escaped by list.js\n",
       "// This extends String.replace to ignore the regex pattern used by list.js and returns\n",
       "// the string unmodified. Other calls should not be affected, unless they use the exact\n",
       "// same pattern and replacement value.\n",
       "// TODO: remove once the issue is fixed in list.js and released\n",
       "String.prototype.replace = (function(_super) {\n",
       "    return function() {\n",
       "        if (\n",
       "            (arguments[0].toString() === &#x27;/[-[\\\\]{}()*+?.,\\\\\\\\^$|#]/g&#x27;)\n",
       "            &amp;&amp; (arguments[1] === &#x27;\\\\$&amp;&#x27;)\n",
       "        ) {\n",
       "            if (this.length === 0) {\n",
       "                return &#x27;&#x27;\n",
       "            }\n",
       "            return this\n",
       "        }\n",
       "        return _super.apply(this, arguments);\n",
       "    };         \n",
       "})(String.prototype.replace);\n",
       "\n",
       "// Switch search type (Text or SMARTS)\n",
       "$(&#x27;#mols2grid .m2g-search-options .m2g-option&#x27;).click(function() {\n",
       "    search_type = $(this).text();\n",
       "    $(&#x27;#mols2grid .m2g-search-options .m2g-option.sel&#x27;).removeClass(&quot;sel&quot;);\n",
       "    $(this).addClass(&quot;sel&quot;);\n",
       "});\n",
       "\n",
       "// Searchbar update event handler\n",
       "$(&#x27;#mols2grid .m2g-searchbar&#x27;).on(&quot;keyup&quot;, function(e) {\n",
       "    var query = e.target.value;\n",
       "    if (search_type === &quot;Text&quot;) {\n",
       "        smarts_matches = {};\n",
       "        listObj.search(query, [&#x27;data-mols2grid-id&#x27;, &#x27;data-Name&#x27;]);\n",
       "    } else {\n",
       "        listObj.search(query, [&quot;data-SMILES&quot;], SmartsSearch);\n",
       "    }\n",
       "});\n",
       "\n",
       "    \n",
       "    // Generate images for the currently displayed molecules.\n",
       "RDKit.prefer_coordgen(true);\n",
       "function draw_mol(smiles, index, template_mol) {\n",
       "    var mol = RDKit.get_mol(smiles, &#x27;{&quot;removeHs&quot;: false }&#x27;);\n",
       "    var svg = &quot;&quot;;\n",
       "    if (mol.is_valid()) {\n",
       "        var highlights = smarts_matches[index];\n",
       "        if (highlights) {\n",
       "            var details = Object.assign({}, draw_opts, highlights);\n",
       "            details = JSON.stringify(details);\n",
       "            mol.generate_aligned_coords(template_mol, true);\n",
       "        } else {\n",
       "            var details = json_draw_opts;\n",
       "        }\n",
       "        svg = mol.get_svg_with_highlights(details);\n",
       "    }\n",
       "    mol.delete();\n",
       "    if (svg == &quot;&quot;) {\n",
       "        return &#x27;&lt;svg width=&quot;130&quot; height=&quot;90&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 130 90&quot;&gt;&lt;/svg&gt;&#x27;;\n",
       "    }\n",
       "    return svg;\n",
       "}\n",
       "\n",
       "// Update images when the list is updated.\n",
       "listObj.on(&quot;updated&quot;, function (list) {\n",
       "    var query = $(&#x27;#mols2grid .m2g-searchbar&#x27;).val();\n",
       "    var template_mol;\n",
       "    if (query === &quot;&quot;) {\n",
       "        smarts_matches = {};\n",
       "        template_mol = null;\n",
       "    } else {\n",
       "        template_mol = RDKit.get_qmol(query);\n",
       "        template_mol.set_new_coords(true);\n",
       "    }\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).each(function() {\n",
       "        var $t = $(this);\n",
       "        var smiles = $t.children(&quot;.data-SMILES&quot;).first().text();\n",
       "        var index = parseInt(this.getAttribute(&quot;data-mols2grid-id&quot;));\n",
       "        var svg = draw_mol(smiles, index, template_mol);\n",
       "        $t.children(&quot;.data-img&quot;).html(svg);\n",
       "    });\n",
       "    if (template_mol) {\n",
       "        template_mol.delete();\n",
       "    }\n",
       "});\n",
       "    \n",
       "\n",
       "    // Trigger update to activate tooltips, draw images, setup callbacks...\n",
       "    listObj.update();\n",
       "    \n",
       "    // Set iframe height to fit content.\n",
       "    fitIframe(window.frameElement);\n",
       "});\n",
       "        &lt;/script&gt;\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\n",
       "\">\n",
       "</iframe>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_csv(\"https://raw.githubusercontent.com/PatWalters/practical_cheminformatics_tutorials/main/data/smarts_test.smi\",sep=\" \",names=[\"SMILES\",\"Name\"])\n",
    "mols2grid.display(df,subset=[\"img\",\"Name\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "58bdb68a",
   "metadata": {},
   "source": [
    "### Bond Primitives\n",
    "Use the grid below to try out of some SMARTS bond primitives.  The table below was taken from [The RDKit Book](https://www.rdkit.org/docs/RDKit_Book.html)\n",
    "<img src=\"https://raw.githubusercontent.com/PatWalters/practical_cheminformatics_tutorials/main/images/smarts_bond_primitives.png\" width=\"500\"/>\n",
    "\n",
    "\n",
    "See if you can find: \n",
    "- Sulfur connected by any ring bond to carbon\n",
    "- A double bond in a ring\n",
    "- Nitriles\n",
    "- Any atom triple bonded to any other atom\n",
    "- A ring carbon bonded to a halogen"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "392e66f2",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:41.185285Z",
     "start_time": "2025-05-05T16:56:41.147057Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2d9b34b19b0c46fb9894d2b344e15b1c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "MolGridWidget()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<style>\n",
       "    /* Some CSS to integrate with Jupyter more cleanly */\n",
       "    div.output_subarea {\n",
       "        /* Undo an unfortunate max-width parameter\n",
       "        that causes the output area to be too narrow\n",
       "        on smaller screens. */\n",
       "        max-width: none;\n",
       "\n",
       "        /* Align the table with the content */\n",
       "        padding: 0;\n",
       "\n",
       "        /* Let it breathe */\n",
       "        margin-top: 20px;\n",
       "    }\n",
       "</style>\n",
       "\n",
       "<iframe class=\"mols2grid-iframe\" frameborder=\"0\" width=\"100%\"\n",
       "    \n",
       "    \n",
       "    allow=\"clipboard-write\"\n",
       "    \n",
       "    \n",
       "    sandbox=\"allow-scripts allow-same-origin allow-downloads allow-popups allow-modals\"\n",
       "    \n",
       "    srcdoc=\"\n",
       "\n",
       "\n",
       "\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;UTF-8&quot; /&gt;\n",
       "        &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt;\n",
       "        &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;\n",
       "        &lt;title&gt;Document!&lt;/title&gt;\n",
       "\n",
       "\n",
       "\n",
       "        &lt;style&gt;\n",
       "            /**\n",
       " * General styling\n",
       " */\n",
       "body {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "}\n",
       "h1,h2,h3,h4 {\n",
       "    margin: 0 0 10px 0;\n",
       "}\n",
       "h1 {\n",
       "    font-size: 26px;\n",
       "}\n",
       "h2 {\n",
       "    font-size: 20px;\n",
       "    font-weight: 400;\n",
       "}\n",
       "h3 {\n",
       "\tfont-size: 16px;\n",
       "}\n",
       "p {\n",
       "    margin: 0 0 10px 0;\n",
       "}\n",
       "\n",
       "\n",
       "/* Remove body margin inside iframe */\n",
       "body.m2g-inside-iframe {\n",
       "    margin: 0;\n",
       "}\n",
       "\n",
       "/* In-cell text */\n",
       "#mols2grid .data:not(.data-img) {\n",
       "    height: 16px;\n",
       "    line-height: 16px;\n",
       "}\n",
       "/* Text truncation */\n",
       "#mols2grid .data {\n",
       "    /* Break text into multiple lines (default for static)... */\n",
       "    word-wrap: normal;\n",
       "\n",
       "    /* ...or truncate it (default for interactive). */\n",
       "    overflow: hidden;\n",
       "    white-space: nowrap;\n",
       "    text-overflow: ellipsis;\n",
       "}\n",
       "\n",
       "\n",
       "/**\n",
       " * Popover\n",
       " * - - -\n",
       " * Note: this is a bootstrap variable which is not namespaced.\n",
       " * To avoid any contamination, we only style it when the\n",
       " * x-placement parameter is set.\n",
       " */\n",
       ".popover[x-placement] {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    background: white;\n",
       "    border: solid 1px rgba(0,0,0,.2);\n",
       "    font-size: 12px;\n",
       "    padding: 10px;\n",
       "    border-radius: 5px;\n",
       "    box-shadow: 0 0 20px rgba(0,0,0,.15);\n",
       "    user-select: none;\n",
       "}\n",
       ".popover[x-placement] h3 {\n",
       "    margin: 0;\n",
       "}\n",
       ".popover[x-placement] .arrow {\n",
       "    width: 10px;\n",
       "    height: 10px;\n",
       "    background: #fff;\n",
       "    border: solid 1px rgba(0,0,0,.2);\n",
       "    box-sizing: border-box;\n",
       "    position: absolute;\n",
       "    transform-origin: 5px 5px;\n",
       "    clip-path: polygon(0 0, 100% 0, 100% 100%);\n",
       "}\n",
       ".popover[x-placement=&#x27;left&#x27;] .arrow {\n",
       "    transform: rotate(45deg);\n",
       "    top: 50%;\n",
       "    right: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;right&#x27;] .arrow {\n",
       "    transform: rotate(-135deg);\n",
       "    top: 50%;\n",
       "    left: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;top&#x27;] .arrow {\n",
       "    transform: rotate(135deg);\n",
       "    left: 50%;\n",
       "    bottom: -5px;\n",
       "}\n",
       ".popover[x-placement=&#x27;bottom&#x27;] .arrow {\n",
       "    transform: rotate(-45deg);\n",
       "    left: 50%;\n",
       "    top: -5px;\n",
       "}\n",
       "            body {\n",
       "    /* Colors */\n",
       "    --m2g-black: rgba(0,0,0,.75);\n",
       "    --m2g-black-soft: rgba(0,0,0,.35);\n",
       "    --m2g-black-10: rgba(0,0,0,.1);\n",
       "    --m2g-bg: #f6f6f6;\n",
       "    --m2g-border: solid 1px rgba(0,0,0,0.2);\n",
       "    --m2g-hl: #555; /* Highlight color */\n",
       "    --m2g-hl-shadow: inset 0 0 0 1px var(--m2g-hl); /* Inset 1px shadow to make border thicker */\n",
       "    --m2g-blue: #0f62fe;\n",
       "    --m2g-blue-soft: rgba(15,98,254,.2);\n",
       "\n",
       "    /* Icons */\n",
       "    --m2g-icn-triangle: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;20&quot; fill=&quot;rgba(0,0,0,.75)&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M9.5713 13.285L6.2543 7.757C6.0543 7.424 6.2953 7 6.6823 7L13.3173 7C13.7053 7 13.9463 7.424 13.7453 7.757L10.4283 13.285C10.2343 13.609 9.7653 13.609 9.5713 13.285Z&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    --m2g-icn-triangle-white: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;20&quot; fill=&quot;white&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M9.5713 13.285L6.2543 7.757C6.0543 7.424 6.2953 7 6.6823 7L13.3173 7C13.7053 7 13.9463 7.424 13.7453 7.757L10.4283 13.285C10.2343 13.609 9.7653 13.609 9.5713 13.285Z&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    --m2g-icn-cb-white: url(&#x27;data:image/svg+xml;utf8,&lt;svg width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 16 16&quot; fill=&quot;none&quot; stroke=&quot;white&quot; stroke-width=&quot;2.5&quot; stroke-linecap=&quot;round&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M4 7.65686L7 10.6569L12.6569 5.00001&quot;/&gt;&lt;/svg&gt;&#x27;);\n",
       "    \n",
       "    /* Border radius */\n",
       "    --m2g-br: 3px;\n",
       "    --m2g-br-l: var(--m2g-br) 0 0 var(--m2g-br); /* Left-only */\n",
       "    --m2g-br-r: 0 var(--m2g-br) var(--m2g-br) 0; /* Right-only */\n",
       "\n",
       "    /* Text */\n",
       "    --m2g-fs: 14px; /* UI font-size */\n",
       "    --m2g-fs-cell: 12px; /* Cell font-size */\n",
       "\n",
       "    /* Transition speeds */\n",
       "    --m2g-trans: 150ms;\n",
       "\n",
       "    /* Layout */\n",
       "    --m2g-h: 40px; /* Form element height */\n",
       "}\n",
       "\n",
       "/* Styling */\n",
       "#mols2grid {\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    font-size: var(--m2g-fs);\n",
       "}\n",
       "\n",
       "/* Fixes */\n",
       "#mols2grid *,\n",
       "#mols2grid *::before,\n",
       "#mols2grid *::after {\n",
       "    box-sizing: border-box;\n",
       "    outline: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Functions section\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-functions {\n",
       "    display: flex;\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-row {\n",
       "    flex: 0;\n",
       "    display: flex;\n",
       "}\n",
       "\n",
       "/* Individual elements don&#x27;t scale */\n",
       "#mols2grid .m2g-functions .m2g-row &gt; * {\n",
       "    flex: 0 0;\n",
       "    margin-right: 10px;\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-row:last-child &gt; *:last-child {\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "/* Row 1: pagination + gap + sort */\n",
       "#mols2grid .m2g-functions .m2g-row:first-child {\n",
       "    flex: 1; /* Scale */\n",
       "}\n",
       "#mols2grid .m2g-functions .m2g-gap {\n",
       "    /* The gap in between will scale, so the pagination\n",
       "    stays on the left, while the rest moves to the right */\n",
       "    flex: 1;\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Pagination\n",
       " */\n",
       "\n",
       "#mols2grid ul.m2g-pagination {\n",
       "    /* Unset defaults */\n",
       "    list-style-type: none;\n",
       "    margin-block-start: 0;\n",
       "    margin-block-end: 0;\n",
       "    margin-inline-start: 0;\n",
       "    margin-inline-end: 0;\n",
       "    padding-inline-start: 0;\n",
       "\n",
       "    /* Custom */\n",
       "    display: flex;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li {\n",
       "    background: var(--m2g-bg) ;\n",
       "    border: var(--m2g-border);\n",
       "    height: var(--m2g-h);\n",
       "    min-width: calc(var(--m2g-h) + 1px);\n",
       "    position: relative;\n",
       "    user-select: none;\n",
       "    \n",
       "    /* Compensate for double border */\n",
       "    margin-right: -1px;\n",
       "    \n",
       "    /* Center text */\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li:last-child {\n",
       "    min-width: var(--m2g-h);\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li a {\n",
       "    text-decoration: none;\n",
       "    color: var(--m2g-black);\n",
       "    padding: 0 10px;\n",
       "    width: 100%;\n",
       "    height: var(--m2g-h);\n",
       "    line-height: var(--m2g-h);\n",
       "    text-align: center;\n",
       "    /* Compensate for border so there&#x27;s no gap between click areas  */\n",
       "    margin: 0 -1px;\n",
       "}\n",
       "\n",
       "/* Corner shape */\n",
       "#mols2grid ul.m2g-pagination li:first-child {\n",
       "    border-radius: var(--m2g-br-l);\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li:last-child {\n",
       "    border-radius: var(--m2g-br-r);\n",
       "    margin-right: 0;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid ul.m2g-pagination li:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "    z-index: 1;\n",
       "}\n",
       "\n",
       "/* Active state */\n",
       "#mols2grid ul.m2g-pagination li.active {\n",
       "    background: var(--m2g-hl);\n",
       "    z-index: 1;\n",
       "}\n",
       "#mols2grid ul.m2g-pagination li.active a {\n",
       "    cursor: default;\n",
       "    color: #fff;\n",
       "}\n",
       "\n",
       "/* Disabled sate */\n",
       "#mols2grid ul.m2g-pagination li.disabled a {\n",
       "    cursor: default;\n",
       "    color: rgba(0,0,0,.25);\n",
       "    pointer-events: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Dropdowns\n",
       " */\n",
       "\n",
       "#mols2grid ::placeholder {\n",
       "    color: var(--m2g-black-soft);\n",
       "}\n",
       "#mols2grid .m2g-dropdown {\n",
       "    height: var(--m2g-h);\n",
       "    background: var(--m2g-bg);\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: var(--m2g-br);\n",
       "    position: relative;\n",
       "}\n",
       "#mols2grid .m2g-dropdown select {\n",
       "    -webkit-appearance: none;\n",
       "    -moz-appearance: none;\n",
       "    -ms-appearance: none;\n",
       "    appearance: none;\n",
       "    background: transparent;\n",
       "    border: none;\n",
       "    height: 100%;\n",
       "    padding: 0 13px;\n",
       "    min-width: 0;\n",
       "    max-width: 250px;\n",
       "    color: var(--m2g-black);\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       "/* Icon */\n",
       "#mols2grid .m2g-dropdown .m2g-icon {\n",
       "    width: 30px;\n",
       "    height: var(--m2g-h);\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "    position: absolute;\n",
       "    top: 0;\n",
       "    right: 0;\n",
       "    pointer-events: none;\n",
       "}\n",
       "#mols2grid .m2g-dropdown .m2g-icon svg:not(.m2g-stroke) {\n",
       "    fill: var(--m2g-black);\n",
       "}\n",
       "#mols2grid .m2g-dropdown .m2g-icon svg.m2g-stroke {\n",
       "    stroke: var(--m2g-black);\n",
       "}\n",
       "\n",
       "/* Display */\n",
       "/* We hide the native select element because\n",
       " * it is limited in styling. Instead, we display\n",
       " * the selected value in a div. */\n",
       "#mols2grid .m2g-dropdown .m2g-display {\n",
       "    position: absolute;\n",
       "    left: 0;\n",
       "    right: 0;\n",
       "    top: 0;\n",
       "    bottom: 0;\n",
       "    pointer-events: none;\n",
       "    color: var(--m2g-black);\n",
       "    line-height: var(--m2g-h);\n",
       "    padding: 0 25px 0 13px;\n",
       "\n",
       "    /* Truncate dropdown text */\n",
       "    white-space: nowrap;\n",
       "\ttext-overflow: ellipsis;\n",
       "\toverflow: hidden;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-dropdown:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Action dropdown\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-dropdown.m2g-actions {\n",
       "    width: var(--m2g-h);\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-actions select {\n",
       "    opacity: 0;\n",
       "    width: var(--m2g-h);\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-actions .m2g-icon {\n",
       "    width: var(--m2g-h);\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Sort dropdown\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-dropdown.m2g-sort {\n",
       "    flex: 0 0 200px;\n",
       "    width: 200px; /* Needed in addition to flex-basis for small sizes! */\n",
       "    border-radius: var(--m2g-br);\n",
       "    background: var(--m2g-bg);\n",
       "    display: flex;\n",
       "}\n",
       "\n",
       "/* Dropdown */\n",
       "#mols2grid .m2g-dropdown.m2g-sort select {\n",
       "    flex: 1 1;\n",
       "    opacity: 0;\n",
       "    /* padding-right: 70px; Space for &quot;Sort:&quot; */\n",
       "    box-sizing: border-box;\n",
       "}\n",
       "\n",
       "/* Sort order */\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-order {\n",
       "    background: var(--m2g-bg) var(--m2g-icn-triangle) no-repeat center;\n",
       "    flex: 0 0 30px;\n",
       "    height: 100%;\n",
       "    border-left: var(--m2g-border);\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-sort.m2d-arrow-desc .m2g-order {\n",
       "    transform: rotate(180deg);\n",
       "    border-left: none;\n",
       "    border-right: var(--m2g-border);\n",
       "}\n",
       "\n",
       "/* Display */\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-display {\n",
       "    right: 31px;\n",
       "    padding-right: 13px;\n",
       "}\n",
       "#mols2grid .m2g-dropdown.m2g-sort .m2g-display::before {\n",
       "    content: &#x27;Sort: &#x27;;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-dropdown.m2g-sort:focus-within .m2g-display,\n",
       "#mols2grid .m2g-dropdown.m2g-sort:focus-within .m2g-order {\n",
       "    background-color: transparent;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/*\n",
       " * Search bar\n",
       " */\n",
       "\n",
       "#mols2grid .m2g-search-wrap {\n",
       "    height: var(--m2g-h);\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: flex-end;\n",
       "    background: var(--m2g-bg);\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: var(--m2g-br);\n",
       "}\n",
       "#mols2grid .m2g-searchbar {\n",
       "    width: 170px;\n",
       "    height: var(--m2g-h);\n",
       "    padding: 0 13px;\n",
       "    border: none;\n",
       "    color: var(--m2g-black);\n",
       "    cursor: text;\n",
       "    background: transparent;\n",
       "}\n",
       "\n",
       "/* Focus state */\n",
       "#mols2grid .m2g-search-wrap:focus-within {\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "/* Option buttons */\n",
       "#mols2grid .m2g-search-options {\n",
       "    font-size: 12px;\n",
       "    display: flex;\n",
       "    height: calc(1.5em + .75rem);\n",
       "    line-height: calc(1.5em + .75rem);\n",
       "    margin-right: 5px;\n",
       "    border-radius: var(--m2g-br);\n",
       "    color: var(--m2g-black);\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option {\n",
       "    background: var(--m2g-black-10);\n",
       "    padding: 0 13px;\n",
       "    cursor: default;\n",
       "    user-select: none;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:not(.sel) {\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:first-child {\n",
       "    border-radius: 2px 0 0 2px;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option:last-child {\n",
       "    border-radius: 0 2px 2px 0;\n",
       "}\n",
       "#mols2grid .m2g-search-options .m2g-option.sel {\n",
       "    background: var(--m2g-hl);\n",
       "    color: #fff;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Grid\n",
       " */\n",
       "\n",
       "/* Container */\n",
       "#mols2grid .m2g-list {\n",
       "    display: flex;\n",
       "    flex-wrap: wrap;\n",
       "    align-items: flex-start;\n",
       "    justify-content: flex-start;\n",
       "    padding: 1px; /* Compensate for negative padding on cell */\n",
       "    user-select: none;\n",
       "    margin: 0px;\n",
       "    margin-top: 20px;\n",
       "    font-family: &#x27;DejaVu&#x27;, sans-serif;\n",
       "    \n",
       "}\n",
       "\n",
       "/* Cell */\n",
       "#mols2grid .m2g-cell {\n",
       "    border: 1px solid #cccccc;\n",
       "    text-align: center;\n",
       "    vertical-align: top;\n",
       "    font-family: var(--font-family);\n",
       "    padding: 10px;\n",
       "    padding-top: max(10px, 20px);\n",
       "    margin: -1px -1px 0 0;\n",
       "    flex: 1 0 130px;\n",
       "    position: relative;\n",
       "    font-size: var(--m2g-fs-cell);\n",
       "    cursor: pointer;\n",
       "    color: var(--m2g-black);\n",
       "    overflow: hidden;\n",
       "    box-sizing: border-box;\n",
       "    background-color: white;\n",
       "}\n",
       "#mols2grid .m2g-cell:focus {\n",
       "    z-index: 1;\n",
       "    border-color: var(--m2g-hl);\n",
       "    box-shadow: var(--m2g-hl-shadow);\n",
       "}\n",
       "\n",
       "/* Phantom cells to maintain grid structure with less results */\n",
       "#mols2grid .m2g-cell.m2g-phantom {\n",
       "    border: none;\n",
       "    pointer-events: none;\n",
       "    height: 0;\n",
       "    padding: 0;\n",
       "}\n",
       "\n",
       "/* Checkbox &amp; ID */\n",
       "#mols2grid .m2g-cb-wrap {\n",
       "    position: absolute;\n",
       "    top: 3px;\n",
       "    left: 3px;\n",
       "    display: flex;\n",
       "    border-radius: 2px;\n",
       "    font-size: 0;\n",
       "    line-height: 0;\n",
       "    padding: 3px;\n",
       "    padding-right: 0;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] {\n",
       "    display: none;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] + .m2g-cb {\n",
       "\twidth: 16px;\n",
       "\theight: 16px;\n",
       "\tbox-sizing: border-box;\n",
       "\tbackground: #fff;\n",
       "\tborder: var(--m2g-border);\n",
       "\tborder-radius: 2px;\n",
       "    margin-right: 5px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox]:checked + .m2g-cb {\n",
       "    border: none;\n",
       "    background-color: var(--m2g-blue);\n",
       "    background-image: var(--m2g-icn-cb-white);\n",
       "}\n",
       "#mols2grid .m2g-tooltip {\n",
       "    /* This is a div spanning full cell size where the\n",
       "    tooltip is rendered around, because you can&#x27;t attach\n",
       "    it to the parent due to list.js limitation. */\n",
       "    width: 100%;\n",
       "    height: 100%;\n",
       "    position: absolute;\n",
       "    left: 0;\n",
       "    top: 0;\n",
       "    z-index: -1;\n",
       "    pointer-events: none;\n",
       "    opacity: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell:has(:checked) {\n",
       "    background: #ffd !important; /* Overrides user-set background color */\n",
       "}\n",
       "#mols2grid .data-mols2grid-id-display {\n",
       "    font-size: var(--m2g-fs-cell);\n",
       "    line-height: 16px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap input[type=checkbox] + .data-mols2grid-id-display {\n",
       "    padding: 0 5px 0 5px;\n",
       "}\n",
       "#mols2grid .m2g-cb-wrap .data-name-display {\n",
       "    font-size: var(--m2g-fs);\n",
       "    line-height: 16px;\n",
       "}\n",
       "\n",
       "/* Info + callback button wrap (28px high) */\n",
       "#mols2grid .m2g-cell-actions {\n",
       "    position: absolute;\n",
       "    top: 0;\n",
       "    right: 0;\n",
       "    display: flex;\n",
       "    flex-direction: row;\n",
       "    font-size: 0;\n",
       "    line-height: 0;\n",
       "    \n",
       "    /* background: yellow; */\n",
       "}\n",
       "\n",
       "/* Info button */\n",
       "#mols2grid .m2g-info {\n",
       "    width: 28px;\n",
       "    height: 28px;\n",
       "    border-radius: 2px;\n",
       "    line-height: 28px;\n",
       "    font-size: min(14px, 12px);\n",
       "    font-family: Georgia, serif;\n",
       "    font-style: italic;\n",
       "    padding: 0;\n",
       "    text-align: center;\n",
       "}\n",
       "#mols2grid .m2g-keep-tooltip .m2g-info {\n",
       "    color: #fff;\n",
       "}\n",
       "#mols2grid .m2g-keep-tooltip .m2g-info::before {\n",
       "    content: &#x27;i&#x27;;\n",
       "    width: 18px;\n",
       "    height: 18px;\n",
       "    line-height: 18px;\n",
       "    background: var(--m2g-hl);\n",
       "    position: absolute;\n",
       "    left: 5px;\n",
       "    top: 5px;\n",
       "    border-radius: 9px;\n",
       "}\n",
       "\n",
       "/* Callback button */\n",
       "#mols2grid .m2g-callback {\n",
       "    width: 28px;\n",
       "    height: 28px;\n",
       "    cursor: pointer;\n",
       "}\n",
       "#mols2grid .m2g-callback::after {\n",
       "    content: &#x27;&#x27;;\n",
       "    display: block;\n",
       "    width: 16px;\n",
       "    height: 16px;\n",
       "    margin: 6px;\n",
       "    border: var(--m2g-border);\n",
       "    border-radius: 2px;\n",
       "    background: var(--m2g-bg) var(--m2g-icn-triangle) no-repeat center;\n",
       "    transform: rotate(-90deg);\n",
       "}\n",
       "\n",
       "/* Image */\n",
       "#mols2grid .m2g-cell .data-img {\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell img,\n",
       "#mols2grid .m2g-cell svg {\n",
       "    max-width: 100%;\n",
       "    height: auto;\n",
       "    padding: 0;\n",
       "}\n",
       "#mols2grid .m2g-cell svg &gt; rect:first-child {\n",
       "    /* Remove the SVG background */\n",
       "    fill: transparent !important;\n",
       "}\n",
       "\n",
       "/* Text below image */\n",
       ".m2g-copy-blink {\n",
       "    animation: m2g-blink var(--m2g-trans) 3;\n",
       "}\n",
       "@keyframes m2g-blink {\n",
       "    0% {\n",
       "        opacity: 1;\n",
       "    }\n",
       "    49% {\n",
       "        opacity: 1;\n",
       "    }\n",
       "    50% {\n",
       "        opacity: 0;\n",
       "    }\n",
       "    100% {\n",
       "        opacity: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* Copyable text */\n",
       ".copy-me {\n",
       "    position: relative;\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Modal popup\n",
       " * - - -\n",
       " * Triggered by make_popup_callback()\n",
       " * See https://mols2grid.readthedocs.io/en/latest/notebooks/callbacks.html#Display-a-popup-containing-descriptors\n",
       " */\n",
       "\n",
       "/* Container */\n",
       "#m2g-modal-container {\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "    justify-content: center;\n",
       "    background: var(--m2g-black-10);\n",
       "    position: fixed;\n",
       "    top: 0;\n",
       "    left: 0;\n",
       "    z-index: 1;\n",
       "    width: 100%;\n",
       "    height: 100%;\n",
       "    \n",
       "    /* Transition */\n",
       "    opacity: 0;\n",
       "    transition: opacity var(--m2g-trans) linear;\n",
       "}\n",
       "\n",
       "/* Modal */\n",
       "#m2g-modal {\n",
       "    background: #fff;\n",
       "    border-radius: var(--m2g-br);\n",
       "    box-shadow: 0 0 30px var(--m2g-black-10);\n",
       "    padding: 20px;\n",
       "    position: relative;\n",
       "    max-width: calc(100% - 80px);\n",
       "    max-height: calc(100% - 80px);\n",
       "    display: flex;\n",
       "    flex-direction: column;\n",
       "    min-width: 26px;\n",
       "\n",
       "    /* Transition */\n",
       "    opacity: 0;\n",
       "    transform: translate(0, 5px);\n",
       "    transition: transform var(--m2g-trans) ease-in-out, opacity var(--m2g-trans) linear;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header {\n",
       "    flex: 0 0 26px;\n",
       "    margin-bottom: 10px;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header h2 {\n",
       "    margin-bottom: 0;\n",
       "}\n",
       "#m2g-modal .m2g-modal-header h2 + p {\n",
       "    font-size: 15px;\n",
       "}\n",
       "#m2g-modal .m2g-modal-body {\n",
       "    flex: 1;\n",
       "    position: relative;\n",
       "}\n",
       "\n",
       "/* Transition */\n",
       "#m2g-modal-container.show {\n",
       "    opacity: 1;\n",
       "}\n",
       "#m2g-modal-container.show #m2g-modal {\n",
       "    opacity: 1;\n",
       "    transform: translate(0, 0);\n",
       "}\n",
       "\n",
       "/* Header + close btn */\n",
       "#m2g-modal h2 {\n",
       "    line-height: 26px;\n",
       "    padding-right: 40px;\n",
       "    text-transform: capitalize;\n",
       "}\n",
       "#m2g-modal h3 {\n",
       "    \n",
       "}\n",
       "#m2g-modal button.close {\n",
       "    background: transparent;\n",
       "    padding: 0;\n",
       "    color: var(--m2g-black);\n",
       "    font-size: 1.5rem;\n",
       "    width: 40px;\n",
       "    height: 40px;\n",
       "    position: absolute;\n",
       "    top: 13px;\n",
       "    right: 13px;\n",
       "    border: none;\n",
       "}\n",
       "\n",
       "/* Image */\n",
       "#m2g-modal .svg-wrap svg {\n",
       "    max-width: 100%;\n",
       "    margin-bottom: 20px;\n",
       "}\n",
       "\n",
       "/* Separator */\n",
       "hr {\n",
       "    width: 100%;\n",
       "    height: 1px;\n",
       "    background: #ddd;\n",
       "    margin: 15px 0;\n",
       "    border: none;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Hover states\n",
       " */\n",
       "@media (hover:hover) {\n",
       "    /* Pagination */\n",
       "    #mols2grid ul.m2g-pagination li:not(.active):not(.disabled):hover {\n",
       "        background: #f0f0f0;\n",
       "        z-index: 1;\n",
       "    }\n",
       "    #mols2grid ul.m2g-pagination li.active + li:hover {\n",
       "        /* Keeping the hover border consiistent */\n",
       "        margin-left: 1px;\n",
       "        border-left: none;\n",
       "        min-width: 40px;\n",
       "    }\n",
       "\n",
       "    /* Dropdowns &amp; search */\n",
       "    #mols2grid .m2g-dropdown:not(:focus-within):hover,\n",
       "    #mols2grid .m2g-search-wrap:not(:focus-within):hover,\n",
       "    #mols2grid .m2g-sort:not(:focus-within) .m2g-order:hover {\n",
       "        background-color: #f0f0f0;\n",
       "    }\n",
       "    #mols2grid .m2g-search-wrap:not(:focus-within):hover {\n",
       "        background: #fff;\n",
       "        border-color: rgba(0,0,0,.3);\n",
       "    }\n",
       "    /* Hocus pocus to have separate hover states for dropdown and arrow */\n",
       "    #mols2grid .m2g-dropdown.m2g-sort:not(:focus-within):hover .m2g-order:not(:hover) + .m2g-display {\n",
       "        background-color: transparent;\n",
       "    }\n",
       "\n",
       "    /* Search options */\n",
       "    #mols2grid .m2g-search-options .m2g-option:not(.sel):hover {\n",
       "        background: rgba(0,0,0,.15);\n",
       "    }\n",
       "\n",
       "    /* Grid */\n",
       "    /* Note: this is in an ::after pseudo element, so the transparent\n",
       "    hover color plays nice with the cell background color. */\n",
       "    #mols2grid .m2g-cell:hover::after {\n",
       "        content: &#x27;&#x27;;\n",
       "        width: 100%;\n",
       "        height: 100%;\n",
       "        position: absolute;\n",
       "        top: 0;\n",
       "        left: 0;\n",
       "        background-color: rgba(0,0,0,0.05);\n",
       "        pointer-events: none;\n",
       "    }\n",
       "\n",
       "    /* info button */\n",
       "    #mols2grid .m2g-info:hover::before {\n",
       "        content: &#x27;i&#x27;;\n",
       "        color: #fff;\n",
       "        width: 18px;\n",
       "        height: 18px;\n",
       "        line-height: 18px;\n",
       "        background: var(--m2g-hl);\n",
       "        position: absolute;\n",
       "        left: 5px;\n",
       "        top: 5px;\n",
       "        border-radius: 9px;\n",
       "    }\n",
       "    \n",
       "    /* Callback button */\n",
       "    #mols2grid .m2g-callback:hover::after {\n",
       "        background-color: var(--m2g-black);\n",
       "        background-image: var(--m2g-icn-triangle-white);\n",
       "        border-color: transparent;\n",
       "    }\n",
       "\n",
       "    /* Copyable text */\n",
       "    .copy-me:hover {\n",
       "        text-decoration: underline;\n",
       "        text-decoration-color: var(--m2g-blue);\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Responsive behavior.\n",
       " * - - -\n",
       " * Note: container queries won&#x27;t work in older browsers,\n",
       " * but this is purely aesthetical behavior so that&#x27;s ok.\n",
       " * https://caniuse.com/css-container-queries\n",
       " */\n",
       "\n",
       "/* This sets the msg-list div as reference container */\n",
       "#mols2grid {\n",
       "    container-type: inline-size;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Functions section\n",
       " */\n",
       "\n",
       "/* When there&#x27;s not enough space to put everything in one row, we break it into two.\n",
       " * - - -\n",
       " * 870px = pagination 280 + sort 200 + search 300 + menu 40 + (3*10 gap) = 850 + 20 buffer.\n",
       " * Buffer required because the button width inside the search depends on the font.\n",
       " */\n",
       "@container (max-width: 870px) {\n",
       "    #mols2grid .m2g-functions {\n",
       "        flex-direction: column-reverse;\n",
       "        gap: 10px;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-row:last-child {\n",
       "        justify-content: flex-end;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-row:first-child *:last-child {\n",
       "        margin-right: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for pagination + sort on one row,\n",
       " * we reduce the sort drodpwon width.\n",
       " */\n",
       "@container (max-width: 500px) {\n",
       "    #mols2grid .m2g-functions .m2g-sort {\n",
       "        width: 80px;\n",
       "        flex-basis: 80px;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-sort .m2g-display {\n",
       "        font-size: 0;\n",
       "        line-height: 0;\n",
       "        padding-right: 0;\n",
       "    }\n",
       "    #mols2grid .m2g-functions .m2g-sort .m2g-display::before {\n",
       "        content: &#x27;Sort&#x27;;\n",
       "        font-size: var(--m2g-fs);\n",
       "        line-height: var(--m2g-h);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for pagination + reduced sort on one row,\n",
       " * we reduce the pagination width.\n",
       " */\n",
       "@container (max-width: 500px) {\n",
       "    /* We&#x27;re overriding min-width from different\n",
       "    locations, including responsive rules */\n",
       "    #mols2grid ul.m2g-pagination li,\n",
       "    #mols2grid ul.m2g-pagination li:last-child,\n",
       "    #mols2grid ul.m2g-pagination li.active + li:hover {\n",
       "        min-width: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s not enough room for searchbar + menu\n",
       " * we scale down the searchbar to fit the container.\n",
       " */\n",
       "@container (max-width: 370px) {\n",
       "    #mols2grid .m2g-functions .m2g-row .m2g-search-wrap {\n",
       "        flex: 1;\n",
       "    }\n",
       "    #mols2grid .m2g-searchbar {\n",
       "        width: calc(100% - 50px);\n",
       "    }\n",
       "    #mols2grid .m2g-search-options {\n",
       "        width: 50px;\n",
       "    }\n",
       "\n",
       "    /* Collapse options in T/M buttons */\n",
       "    #mols2grid .m2g-search-options .m2g-option {\n",
       "        width: 25px;\n",
       "        text-align: center;\n",
       "        padding: 0;\n",
       "        overflow: hidden;\n",
       "    }\n",
       "    #mols2grid .m2g-search-options .m2g-option:first-child::before {\n",
       "        content: &#x27;T\\A&#x27;\n",
       "    }\n",
       "    #mols2grid .m2g-search-options .m2g-option:last-child::before {\n",
       "        content: &#x27;S\\A&#x27;\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Grid\n",
       " */\n",
       "\n",
       "/* When there&#x27;s room for 5 columns, fall back to 4 */\n",
       "@container (min-width: 519px) and (max-width: 779px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 4);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s room for 7-11 columns, fall back to 6 */\n",
       "@container (min-width: 779px) and (max-width: 1559px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 6);\n",
       "    }\n",
       "}\n",
       "\n",
       "/* When there&#x27;s room for 13+ columns, fall back to 12 */\n",
       "@container (min-width: 1559px) {\n",
       "    #mols2grid .m2g-cell {\n",
       "        flex-basis: calc(100% / 12);\n",
       "    }\n",
       "}\n",
       "\n",
       "            /* Custom CSS */\n",
       "            \n",
       "        &lt;/style&gt;\n",
       "        &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js&quot;&gt;&lt;/script&gt;\n",
       "&lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot; integrity=&quot;sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;\n",
       "&lt;script src=&quot;https://unpkg.com/@rdkit/rdkit@2022.3.1/Code/MinimalLib/dist/RDKit_minimal.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script&gt;\n",
       "    // Set iframe height to fit content.\n",
       "    function fitIframe(iframe) {\n",
       "        // Ignore when there&#x27;s no iframe\n",
       "        if (!iframe) return\n",
       "\n",
       "        // Only fit height when no specific height was given.\n",
       "        if (iframe.getAttribute(&#x27;height&#x27;)) return;\n",
       "\n",
       "        // Initial fit + refit whenever the window width changes.\n",
       "        _fit()\n",
       "        $(window).on(&#x27;resize&#x27;, function() {\n",
       "            if (window.innerWidth != window.prevInnerWidth) {\n",
       "                window.prevInnerWidth = window.innerWidth\n",
       "                _fit();\n",
       "            }\n",
       "        })\n",
       "\n",
       "        // Fit iframe height to content height.\n",
       "        function _fit() {\n",
       "            var height = iframe.contentDocument.body.scrollHeight + 18 + &#x27;px&#x27;;\n",
       "            iframe.style.height = height;\n",
       "        }\n",
       "    }\n",
       "&lt;/script&gt;\n",
       "\n",
       "&lt;!-- prettier-ignore --&gt;\n",
       "&lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js&quot; integrity=&quot;sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;\n",
       "        \n",
       "        &lt;!-- Custom header --&gt;\n",
       "        \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "    &lt;/head&gt;\n",
       "    &lt;body class=&quot;m2g-inside-iframe&quot;&gt;\n",
       "\n",
       "\n",
       "\n",
       "        &lt;div id=&quot;mols2grid&quot; class=&quot;grid-default&quot;&gt;\n",
       "            &lt;!-- Pagination &amp; search --&gt;\n",
       "            &lt;div class=&quot;m2g-functions&quot;&gt;\n",
       "                \n",
       "                &lt;div class=&quot;m2g-row&quot;&gt;\n",
       "                    &lt;!-- Pagination --&gt;\n",
       "                    &lt;ul class=&quot;m2g-pagination&quot; class=&quot;d-flex&quot;&gt;&lt;/ul&gt;\n",
       "                    &lt;div class=&quot;m2g-gap&quot;&gt;&lt;/div&gt;\n",
       "\n",
       "                    &lt;!-- Sort dropdown --&gt;\n",
       "                    &lt;div class=&quot;m2g-dropdown m2g-sort&quot;&gt;\n",
       "                        &lt;select&gt;\n",
       "                            \n",
       "                            \n",
       "                                \n",
       "                                \n",
       "                                \n",
       "                            &lt;option value=&quot;mols2grid-id&quot; selected&gt;Index&lt;/option&gt;\n",
       "                                \n",
       "                            \n",
       "                                \n",
       "                                \n",
       "                                \n",
       "                            &lt;option value=&quot;data-Name&quot;&gt;Name&lt;/option&gt;\n",
       "                                \n",
       "                            \n",
       "                            \n",
       "                            &lt;option value=&quot;checkbox&quot;&gt;Selected&lt;/option&gt;\n",
       "                            \n",
       "                        &lt;/select&gt;\n",
       "                        &lt;div class=&quot;m2g-order&quot;&gt;&lt;/div&gt;\n",
       "                        &lt;div class=&quot;m2g-display&quot;&gt;\n",
       "                            Index\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "                &lt;/div&gt;\n",
       "                &lt;div class=&quot;m2g-row&quot;&gt;\n",
       "                    &lt;!-- Search bar --&gt;\n",
       "                    &lt;div class=&quot;m2g-search-wrap&quot;&gt;\n",
       "                        &lt;input\n",
       "                            type=&quot;text&quot;\n",
       "                            class=&quot;m2g-searchbar form-control&quot;\n",
       "                            placeholder=&quot;Search&quot;\n",
       "                            aria-label=&quot;Search&quot;\n",
       "                            aria-describedby=&quot;basic-addon1&quot;\n",
       "                        /&gt;\n",
       "                        &lt;div class=&quot;m2g-search-options&quot;&gt;\n",
       "                            &lt;div class=&quot;m2g-option m2g-search-text sel&quot;&gt;Text&lt;/div&gt;\n",
       "                            &lt;div class=&quot;m2g-option m2g-search-smarts&quot;&gt;SMARTS&lt;/div&gt;\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "\n",
       "                    &lt;!-- Action dropdown --&gt;\n",
       "                    &lt;div class=&quot;m2g-dropdown m2g-actions&quot;&gt;\n",
       "                        &lt;select&gt;\n",
       "                            &lt;option hidden&gt;-&lt;/option&gt;\n",
       "                            &lt;option value=&quot;select-all&quot;&gt;Select all&lt;/option&gt;\n",
       "                            &lt;option value=&quot;select-matching&quot;&gt;Select matching&lt;/option&gt;\n",
       "                            &lt;option value=&quot;unselect-all&quot;&gt;Unselect all&lt;/option&gt;\n",
       "                            &lt;option value=&quot;invert&quot;&gt;Invert&lt;/option&gt;\n",
       "                            &lt;option value=&quot;copy&quot;&gt;Copy to clipboard&lt;/option&gt;\n",
       "                            &lt;option value=&quot;save-smiles&quot;&gt;Save SMILES&lt;/option&gt;\n",
       "                            &lt;option value=&quot;save-csv&quot;&gt;Save CSV&lt;/option&gt;\n",
       "                        &lt;/select&gt;\n",
       "                        &lt;div class=&quot;m2g-icon&quot;&gt;\n",
       "                            &lt;svg width=&quot;20&quot; height=&quot;20&quot; viewBox=&quot;0 0 20 20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;\n",
       "                                &lt;path d=&quot;M11.5 4C11.5 4.82843 10.8284 5.5 10 5.5C9.17157 5.5 8.5 4.82843 8.5 4C8.5 3.17157 9.17157 2.5 10 2.5C10.8284 2.5 11.5 3.17157 11.5 4ZM11.5 10C11.5 10.8284 10.8284 11.5 10 11.5C9.17157 11.5 8.5 10.8284 8.5 10C8.5 9.17157 9.17157 8.5 10 8.5C10.8284 8.5 11.5 9.17157 11.5 10ZM10 17.5C10.8284 17.5 11.5 16.8284 11.5 16C11.5 15.1716 10.8284 14.5 10 14.5C9.17157 14.5 8.5 15.1716 8.5 16C8.5 16.8284 9.17157 17.5 10 17.5Z&quot;/&gt;\n",
       "                            &lt;/svg&gt;\n",
       "                        &lt;/div&gt;\n",
       "                    &lt;/div&gt;\n",
       "                &lt;/div&gt;\n",
       "            &lt;/div&gt;\n",
       "\n",
       "            &lt;!-- Grid --&gt;\n",
       "            \n",
       "            &lt;div class=&quot;m2g-list&quot;&gt;&lt;div class=&quot;m2g-cell&quot; data-mols2grid-id=&quot;0&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;m2g-cb-wrap&quot;&gt;&lt;input type=&quot;checkbox&quot; tabindex=&quot;-1&quot; class=&quot;position-relative float-left cached_checkbox&quot;&gt;&lt;div class=&quot;m2g-cb&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data-mols2grid-id-display&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;m2g-cell-actions&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-img copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-Name copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-SMILES copy-me&quot; style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;\n",
       "        &lt;/div&gt;\n",
       "        &lt;script&gt;\n",
       "            // list.js\n",
       "var listObj = new List(&#x27;mols2grid&#x27;, {\n",
       "    listClass: &#x27;m2g-list&#x27;,\n",
       "    valueNames: [{data: [&#x27;mols2grid-id&#x27;]}, &#x27;data-mols2grid-id&#x27;, &#x27;data-SMILES&#x27;, &#x27;data-img&#x27;, &#x27;data-Name&#x27;, &#x27;data-mols2grid-id-display&#x27;],\n",
       "    item: &#x27;&lt;div class=&quot;m2g-cell&quot; data-mols2grid-id=&quot;0&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;m2g-cb-wrap&quot;&gt;&lt;input type=&quot;checkbox&quot; tabindex=&quot;-1&quot; class=&quot;position-relative float-left cached_checkbox&quot;&gt;&lt;div class=&quot;m2g-cb&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data-mols2grid-id-display&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;m2g-cell-actions&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-img copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-Name copy-me&quot;&gt;&lt;/div&gt;&lt;div class=&quot;data data-SMILES copy-me&quot; style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&#x27;,\n",
       "    page: 24,\n",
       "    pagination: {\n",
       "        paginationClass: &quot;m2g-pagination&quot;,\n",
       "        item: &#x27;&lt;li class=&quot;page-item&quot;&gt;&lt;a class=&quot;page page-link&quot; href=&quot;#&quot; onclick=&quot;event.preventDefault()&quot;&gt;&lt;/a&gt;&lt;/li&gt;&#x27;,\n",
       "        innerWindow: 1,\n",
       "        outerWindow: 1,\n",
       "    },\n",
       "});\n",
       "listObj.remove(&quot;mols2grid-id&quot;, &quot;0&quot;);\n",
       "listObj.add([{&quot;mols2grid-id&quot;: 0, &quot;data-SMILES&quot;: &quot;CN1C(=O)CO[C@H]2CNC[C@@H]21&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95346843, &quot;data-mols2grid-id-display&quot;: 0}, {&quot;mols2grid-id&quot;: 1, &quot;data-SMILES&quot;: &quot;N[S@](=O)C1CS(=O)(=O)C1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 675072173, &quot;data-mols2grid-id-display&quot;: 1}, {&quot;mols2grid-id&quot;: 2, &quot;data-SMILES&quot;: &quot;CNC(=O)c1n[nH]c(N)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19844301, &quot;data-mols2grid-id-display&quot;: 2}, {&quot;mols2grid-id&quot;: 3, &quot;data-SMILES&quot;: &quot;NC1=NC[C@@H](C(=O)O)CN1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 38415755, &quot;data-mols2grid-id-display&quot;: 3}, {&quot;mols2grid-id&quot;: 4, &quot;data-SMILES&quot;: &quot;N=C(N)NC[C@@H](N)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1576365, &quot;data-mols2grid-id-display&quot;: 4}, {&quot;mols2grid-id&quot;: 5, &quot;data-SMILES&quot;: &quot;COCCNC(=O)NCCN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 41167662, &quot;data-mols2grid-id-display&quot;: 5}, {&quot;mols2grid-id&quot;: 6, &quot;data-SMILES&quot;: &quot;NCCOCCOCCN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1651868, &quot;data-mols2grid-id-display&quot;: 6}, {&quot;mols2grid-id&quot;: 7, &quot;data-SMILES&quot;: &quot;NCC1(N)COC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95644286, &quot;data-mols2grid-id-display&quot;: 7}, {&quot;mols2grid-id&quot;: 8, &quot;data-SMILES&quot;: &quot;NC(=O)[C@H]1[C@H]2C=C[C@@H](O2)[C@@H]1N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 242677143, &quot;data-mols2grid-id-display&quot;: 8}, {&quot;mols2grid-id&quot;: 9, &quot;data-SMILES&quot;: &quot;O[C@@H]1CO[C@H]2[C@H]1OC[C@H]2O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4521362, &quot;data-mols2grid-id-display&quot;: 9}, {&quot;mols2grid-id&quot;: 10, &quot;data-SMILES&quot;: &quot;CN1CCOC(CO)(CO)C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 96024984, &quot;data-mols2grid-id-display&quot;: 10}, {&quot;mols2grid-id&quot;: 11, &quot;data-SMILES&quot;: &quot;C#CC[C@@H](N)C(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 78724393, &quot;data-mols2grid-id-display&quot;: 11}, {&quot;mols2grid-id&quot;: 12, &quot;data-SMILES&quot;: &quot;COCCN1CN=C(NC#N)NC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19329625, &quot;data-mols2grid-id-display&quot;: 12}, {&quot;mols2grid-id&quot;: 13, &quot;data-SMILES&quot;: &quot;NC[C@H](O)[C@H](O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2384201, &quot;data-mols2grid-id-display&quot;: 13}, {&quot;mols2grid-id&quot;: 14, &quot;data-SMILES&quot;: &quot;CO[C@H]1OC[C@H](O)[C@H](O)[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1041345, &quot;data-mols2grid-id-display&quot;: 14}, {&quot;mols2grid-id&quot;: 15, &quot;data-SMILES&quot;: &quot;NC(=O)[C@]1(N2CCNCC2)CCOC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 70992702, &quot;data-mols2grid-id-display&quot;: 15}, {&quot;mols2grid-id&quot;: 16, &quot;data-SMILES&quot;: &quot;O=c1[nH]cc(N2CCOCC2)c(=O)[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 55860, &quot;data-mols2grid-id-display&quot;: 16}, {&quot;mols2grid-id&quot;: 17, &quot;data-SMILES&quot;: &quot;NCC(CN)(CN)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34370327, &quot;data-mols2grid-id-display&quot;: 17}, {&quot;mols2grid-id&quot;: 18, &quot;data-SMILES&quot;: &quot;O=C(O)c1cn(CCO)nn1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 36379848, &quot;data-mols2grid-id-display&quot;: 18}, {&quot;mols2grid-id&quot;: 19, &quot;data-SMILES&quot;: &quot;N#CNc1nc(N)nc(N)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 32191040, &quot;data-mols2grid-id-display&quot;: 19}, {&quot;mols2grid-id&quot;: 20, &quot;data-SMILES&quot;: &quot;CCC(=O)C1C(=O)NC(=O)NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 100739101, &quot;data-mols2grid-id-display&quot;: 20}, {&quot;mols2grid-id&quot;: 21, &quot;data-SMILES&quot;: &quot;OC[C@H]1NCC[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 14455330, &quot;data-mols2grid-id-display&quot;: 21}, {&quot;mols2grid-id&quot;: 22, &quot;data-SMILES&quot;: &quot;COC(=O)[C@@H](O)[C@H](O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1682447, &quot;data-mols2grid-id-display&quot;: 22}, {&quot;mols2grid-id&quot;: 23, &quot;data-SMILES&quot;: &quot;N[C@H](CC[C@@H](N)C(=O)O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1603017, &quot;data-mols2grid-id-display&quot;: 23}, {&quot;mols2grid-id&quot;: 24, &quot;data-SMILES&quot;: &quot;CN1C(=O)NC(=O)C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1532166, &quot;data-mols2grid-id-display&quot;: 24}, {&quot;mols2grid-id&quot;: 25, &quot;data-SMILES&quot;: &quot;N[C@@H](C[C@@H](N)C(=O)O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1689056, &quot;data-mols2grid-id-display&quot;: 25}, {&quot;mols2grid-id&quot;: 26, &quot;data-SMILES&quot;: &quot;COS(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95588085, &quot;data-mols2grid-id-display&quot;: 26}, {&quot;mols2grid-id&quot;: 27, &quot;data-SMILES&quot;: &quot;O=C1N[C@@H]2Nc3nonc3N[C@H]2N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3662018, &quot;data-mols2grid-id-display&quot;: 27}, {&quot;mols2grid-id&quot;: 28, &quot;data-SMILES&quot;: &quot;OC[C@@H]1O[C@@H](O)[C@H](CO)O[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 105090729, &quot;data-mols2grid-id-display&quot;: 28}, {&quot;mols2grid-id&quot;: 29, &quot;data-SMILES&quot;: &quot;O=C(O)CN[C@H]1C=CS(=O)(=O)C1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4298576, &quot;data-mols2grid-id-display&quot;: 29}, {&quot;mols2grid-id&quot;: 30, &quot;data-SMILES&quot;: &quot;CC(=O)N[C@@H](O)[C@H](O)NC(C)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3668823, &quot;data-mols2grid-id-display&quot;: 30}, {&quot;mols2grid-id&quot;: 31, &quot;data-SMILES&quot;: &quot;N[C@H]1[C@H](O)[C@@H](O)[C@H](CO)O[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5443821, &quot;data-mols2grid-id-display&quot;: 31}, {&quot;mols2grid-id&quot;: 32, &quot;data-SMILES&quot;: &quot;CC(=O)NCCC(=O)NCCO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 35100900, &quot;data-mols2grid-id-display&quot;: 32}, {&quot;mols2grid-id&quot;: 33, &quot;data-SMILES&quot;: &quot;C[C@H]1O[C@H](O)[C@@H](O)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1532676, &quot;data-mols2grid-id-display&quot;: 33}, {&quot;mols2grid-id&quot;: 34, &quot;data-SMILES&quot;: &quot;COCCOCCNC(=O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 44728718, &quot;data-mols2grid-id-display&quot;: 34}, {&quot;mols2grid-id&quot;: 35, &quot;data-SMILES&quot;: &quot;O=c1[nH]c(=O)[nH]c(=O)[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 18044615, &quot;data-mols2grid-id-display&quot;: 35}, {&quot;mols2grid-id&quot;: 36, &quot;data-SMILES&quot;: &quot;C[C@@H](O)CNc1c[nH]c(=O)[nH]c1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4827211, &quot;data-mols2grid-id-display&quot;: 36}, {&quot;mols2grid-id&quot;: 37, &quot;data-SMILES&quot;: &quot;COC(=O)[C@H](N)CC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 32098738, &quot;data-mols2grid-id-display&quot;: 37}, {&quot;mols2grid-id&quot;: 38, &quot;data-SMILES&quot;: &quot;CS(=O)(=O)CCS(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 44594710, &quot;data-mols2grid-id-display&quot;: 38}, {&quot;mols2grid-id&quot;: 39, &quot;data-SMILES&quot;: &quot;CNCc1nnn[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 42191848, &quot;data-mols2grid-id-display&quot;: 39}, {&quot;mols2grid-id&quot;: 40, &quot;data-SMILES&quot;: &quot;NS(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 238809258, &quot;data-mols2grid-id-display&quot;: 40}, {&quot;mols2grid-id&quot;: 41, &quot;data-SMILES&quot;: &quot;Nc1nc(N)n2c(N)nnc2n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 16889989, &quot;data-mols2grid-id-display&quot;: 41}, {&quot;mols2grid-id&quot;: 42, &quot;data-SMILES&quot;: &quot;NC(=O)C1(C(N)=O)CC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1692815, &quot;data-mols2grid-id-display&quot;: 42}, {&quot;mols2grid-id&quot;: 43, &quot;data-SMILES&quot;: &quot;NC(=O)N[C@@H]1NC(=O)NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1843030, &quot;data-mols2grid-id-display&quot;: 43}, {&quot;mols2grid-id&quot;: 44, &quot;data-SMILES&quot;: &quot;O=C1CC(=O)NC(=S)N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 8727446, &quot;data-mols2grid-id-display&quot;: 44}, {&quot;mols2grid-id&quot;: 45, &quot;data-SMILES&quot;: &quot;O=C(NCCO)C1=NN=CC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5494790, &quot;data-mols2grid-id-display&quot;: 45}, {&quot;mols2grid-id&quot;: 46, &quot;data-SMILES&quot;: &quot;NCC(O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1693258, &quot;data-mols2grid-id-display&quot;: 46}, {&quot;mols2grid-id&quot;: 47, &quot;data-SMILES&quot;: &quot;CC(=O)NCCNc1cn[nH]c(=O)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 11991023, &quot;data-mols2grid-id-display&quot;: 47}, {&quot;mols2grid-id&quot;: 48, &quot;data-SMILES&quot;: &quot;COC[C@H](N)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34426550, &quot;data-mols2grid-id-display&quot;: 48}, {&quot;mols2grid-id&quot;: 49, &quot;data-SMILES&quot;: &quot;N#CNC1=NC(=O)CC(=O)N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5133260, &quot;data-mols2grid-id-display&quot;: 49}, {&quot;mols2grid-id&quot;: 50, &quot;data-SMILES&quot;: &quot;O=C1NCCN[C@]1(O)C(F)(F)F&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4204973, &quot;data-mols2grid-id-display&quot;: 50}, {&quot;mols2grid-id&quot;: 51, &quot;data-SMILES&quot;: &quot;NC(=O)[C@H](O)[C@H]1CCOC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 50976959, &quot;data-mols2grid-id-display&quot;: 51}, {&quot;mols2grid-id&quot;: 52, &quot;data-SMILES&quot;: &quot;N[C@H]1[C@H](O)O[C@H](CO)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3860468, &quot;data-mols2grid-id-display&quot;: 52}, {&quot;mols2grid-id&quot;: 53, &quot;data-SMILES&quot;: &quot;O=C(O)c1nc(=O)[nH]c(=O)[nH]1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 13514753, &quot;data-mols2grid-id-display&quot;: 53}, {&quot;mols2grid-id&quot;: 54, &quot;data-SMILES&quot;: &quot;NC(=O)CN1CCOCC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 20436848, &quot;data-mols2grid-id-display&quot;: 54}, {&quot;mols2grid-id&quot;: 55, &quot;data-SMILES&quot;: &quot;N#CNC1=NCN(CCO)CN1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19330782, &quot;data-mols2grid-id-display&quot;: 55}, {&quot;mols2grid-id&quot;: 56, &quot;data-SMILES&quot;: &quot;O=C(O)CNC(=O)CC(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 45285524, &quot;data-mols2grid-id-display&quot;: 56}, {&quot;mols2grid-id&quot;: 57, &quot;data-SMILES&quot;: &quot;CO[C@@H]1[C@H](O)[C@H](C)O[C@H](CO)[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 166514298, &quot;data-mols2grid-id-display&quot;: 57}, {&quot;mols2grid-id&quot;: 58, &quot;data-SMILES&quot;: &quot;N#CNC(=N)N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5112486, &quot;data-mols2grid-id-display&quot;: 58}, {&quot;mols2grid-id&quot;: 59, &quot;data-SMILES&quot;: &quot;O=C(c1c[nH]c(=O)[nH]1)N1CCNCC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 20258057, &quot;data-mols2grid-id-display&quot;: 59}, {&quot;mols2grid-id&quot;: 60, &quot;data-SMILES&quot;: &quot;O=C(O)C12CNCC1CNC2&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 306937672, &quot;data-mols2grid-id-display&quot;: 60}, {&quot;mols2grid-id&quot;: 61, &quot;data-SMILES&quot;: &quot;NCc1cc(=O)[nH]c(O)n1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 26507110, &quot;data-mols2grid-id-display&quot;: 61}, {&quot;mols2grid-id&quot;: 62, &quot;data-SMILES&quot;: &quot;O[C@@H]1[C@@H](O)[C@H]2[C@@H](O)CCN2C[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 247855053, &quot;data-mols2grid-id-display&quot;: 62}, {&quot;mols2grid-id&quot;: 63, &quot;data-SMILES&quot;: &quot;C[C@H](O)[C@H](O)[C@H](O)[C@@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 137815004, &quot;data-mols2grid-id-display&quot;: 63}, {&quot;mols2grid-id&quot;: 64, &quot;data-SMILES&quot;: &quot;N#CN(CCO)CCO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 62715247, &quot;data-mols2grid-id-display&quot;: 64}, {&quot;mols2grid-id&quot;: 65, &quot;data-SMILES&quot;: &quot;N#C[C@H]1CS(=O)(=O)C[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 68985053, &quot;data-mols2grid-id-display&quot;: 65}, {&quot;mols2grid-id&quot;: 66, &quot;data-SMILES&quot;: &quot;C[S@@](=O)CC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34310585, &quot;data-mols2grid-id-display&quot;: 66}, {&quot;mols2grid-id&quot;: 67, &quot;data-SMILES&quot;: &quot;COC[C@@H](O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2263862, &quot;data-mols2grid-id-display&quot;: 67}, {&quot;mols2grid-id&quot;: 68, &quot;data-SMILES&quot;: &quot;CN1C(=O)[C@@H]2CNCCN2C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 72314731, &quot;data-mols2grid-id-display&quot;: 68}, {&quot;mols2grid-id&quot;: 69, &quot;data-SMILES&quot;: &quot;CN(C)CCN(C)S(N)(=O)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 98210169, &quot;data-mols2grid-id-display&quot;: 69}, {&quot;mols2grid-id&quot;: 70, &quot;data-SMILES&quot;: &quot;CS(=O)(=O)NC1CNC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 83119925, &quot;data-mols2grid-id-display&quot;: 70}, {&quot;mols2grid-id&quot;: 71, &quot;data-SMILES&quot;: &quot;CN(C)S(=O)(=O)NC#N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5524996, &quot;data-mols2grid-id-display&quot;: 71}, {&quot;mols2grid-id&quot;: 72, &quot;data-SMILES&quot;: &quot;N#CN(CS(=O)(=O)O)C(=N)N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4411341, &quot;data-mols2grid-id-display&quot;: 72}, {&quot;mols2grid-id&quot;: 73, &quot;data-SMILES&quot;: &quot;CO[C@@H]1O[C@H](C)[C@H](O)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 43505237, &quot;data-mols2grid-id-display&quot;: 73}, {&quot;mols2grid-id&quot;: 74, &quot;data-SMILES&quot;: &quot;Cn1ncc2c(=O)[nH]c(NN)nc21&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 16969122, &quot;data-mols2grid-id-display&quot;: 74}, {&quot;mols2grid-id&quot;: 75, &quot;data-SMILES&quot;: &quot;CN1C(=O)[C@@H]2CNC[C@H]2C1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 105580712, &quot;data-mols2grid-id-display&quot;: 75}, {&quot;mols2grid-id&quot;: 76, &quot;data-SMILES&quot;: &quot;O[C@@H]1[C@@H]2O[C@H]2[C@@H](O)[C@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 253639163, &quot;data-mols2grid-id-display&quot;: 76}, {&quot;mols2grid-id&quot;: 77, &quot;data-SMILES&quot;: &quot;N[C@@H]1N=CC=NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 39778426, &quot;data-mols2grid-id-display&quot;: 77}, {&quot;mols2grid-id&quot;: 78, &quot;data-SMILES&quot;: &quot;NC(=O)[C@H](N)[C@@H]1CCOC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 37870616, &quot;data-mols2grid-id-display&quot;: 78}, {&quot;mols2grid-id&quot;: 79, &quot;data-SMILES&quot;: &quot;C[C@H](O)[C@@H](O)[C@@H](O)[C@H](O)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 901090, &quot;data-mols2grid-id-display&quot;: 79}, {&quot;mols2grid-id&quot;: 80, &quot;data-SMILES&quot;: &quot;O=C1N[C@@H]2NC(=O)N(CCO)[C@H]2N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2251996, &quot;data-mols2grid-id-display&quot;: 80}, {&quot;mols2grid-id&quot;: 81, &quot;data-SMILES&quot;: &quot;O=S1(=O)NCCO1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 95708091, &quot;data-mols2grid-id-display&quot;: 81}, {&quot;mols2grid-id&quot;: 82, &quot;data-SMILES&quot;: &quot;NNc1n[nH]c(=S)n1N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 12958520, &quot;data-mols2grid-id-display&quot;: 82}, {&quot;mols2grid-id&quot;: 83, &quot;data-SMILES&quot;: &quot;O=C(CO)[C@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 901232, &quot;data-mols2grid-id-display&quot;: 83}, {&quot;mols2grid-id&quot;: 84, &quot;data-SMILES&quot;: &quot;O=C(O)C(=O)C[C@@H](O)[C@@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1532571, &quot;data-mols2grid-id-display&quot;: 84}, {&quot;mols2grid-id&quot;: 85, &quot;data-SMILES&quot;: &quot;NCC(=O)CN&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1558643, &quot;data-mols2grid-id-display&quot;: 85}, {&quot;mols2grid-id&quot;: 86, &quot;data-SMILES&quot;: &quot;C[C@H](N)C(=O)N[C@H](C)C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1575495, &quot;data-mols2grid-id-display&quot;: 86}, {&quot;mols2grid-id&quot;: 87, &quot;data-SMILES&quot;: &quot;NC(=O)CCNC(=O)CCC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 57218621, &quot;data-mols2grid-id-display&quot;: 87}, {&quot;mols2grid-id&quot;: 88, &quot;data-SMILES&quot;: &quot;C[C@]1(CN)NC(=O)NC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 39401552, &quot;data-mols2grid-id-display&quot;: 88}, {&quot;mols2grid-id&quot;: 89, &quot;data-SMILES&quot;: &quot;O=C1CNC(=S)N1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1089842, &quot;data-mols2grid-id-display&quot;: 89}, {&quot;mols2grid-id&quot;: 90, &quot;data-SMILES&quot;: &quot;O=C(CO)[C@@H](O)[C@@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 902219, &quot;data-mols2grid-id-display&quot;: 90}, {&quot;mols2grid-id&quot;: 91, &quot;data-SMILES&quot;: &quot;CC(C)NC(=O)[C@@H](N)CC(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 34770001, &quot;data-mols2grid-id-display&quot;: 91}, {&quot;mols2grid-id&quot;: 92, &quot;data-SMILES&quot;: &quot;COC[C@H](O)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2504425, &quot;data-mols2grid-id-display&quot;: 92}, {&quot;mols2grid-id&quot;: 93, &quot;data-SMILES&quot;: &quot;CO[C@H]1OC[C@@H](O)[C@H](O)[C@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4371221, &quot;data-mols2grid-id-display&quot;: 93}, {&quot;mols2grid-id&quot;: 94, &quot;data-SMILES&quot;: &quot;NC(=O)CN1CCC(N)CC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 9256947, &quot;data-mols2grid-id-display&quot;: 94}, {&quot;mols2grid-id&quot;: 95, &quot;data-SMILES&quot;: &quot;CNC(=S)NC(=N)N&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 33691246, &quot;data-mols2grid-id-display&quot;: 95}, {&quot;mols2grid-id&quot;: 96, &quot;data-SMILES&quot;: &quot;N=C(N)CN1CC[C@H](O)C1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 203414649, &quot;data-mols2grid-id-display&quot;: 96}, {&quot;mols2grid-id&quot;: 97, &quot;data-SMILES&quot;: &quot;N=C(N)[C@@H](NC=O)C(N)=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 66370807, &quot;data-mols2grid-id-display&quot;: 97}, {&quot;mols2grid-id&quot;: 98, &quot;data-SMILES&quot;: &quot;NS(=O)(=O)NC1CCOCC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 160854167, &quot;data-mols2grid-id-display&quot;: 98}, {&quot;mols2grid-id&quot;: 99, &quot;data-SMILES&quot;: &quot;O=C1N[C@@H](CO)C(=O)N2CCC[C@@H]12&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 5374243, &quot;data-mols2grid-id-display&quot;: 99}, {&quot;mols2grid-id&quot;: 100, &quot;data-SMILES&quot;: &quot;O=C1O[C@@H]2C[C@@]1(O)C[C@H](O)[C@@H]2O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 71786849, &quot;data-mols2grid-id-display&quot;: 100}, {&quot;mols2grid-id&quot;: 101, &quot;data-SMILES&quot;: &quot;O=C1O[C@H](CO)[C@@H](O)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3861798, &quot;data-mols2grid-id-display&quot;: 101}, {&quot;mols2grid-id&quot;: 102, &quot;data-SMILES&quot;: &quot;NC(=O)N1C[C@H](O)C[C@H]1C(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 3257688, &quot;data-mols2grid-id-display&quot;: 102}, {&quot;mols2grid-id&quot;: 103, &quot;data-SMILES&quot;: &quot;O=C(O)C(=O)CS(=O)(=O)O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 4096823, &quot;data-mols2grid-id-display&quot;: 103}, {&quot;mols2grid-id&quot;: 104, &quot;data-SMILES&quot;: &quot;NCCNC(=O)[C@@H]1CCCNC1=O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 2570758, &quot;data-mols2grid-id-display&quot;: 104}, {&quot;mols2grid-id&quot;: 105, &quot;data-SMILES&quot;: &quot;NCCc1nnc2c(=O)[nH]ccn12&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 409423317, &quot;data-mols2grid-id-display&quot;: 105}, {&quot;mols2grid-id&quot;: 106, &quot;data-SMILES&quot;: &quot;OC[C@H]1O[C@H](O)[C@@H](F)[C@@H]1O&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 44154413, &quot;data-mols2grid-id-display&quot;: 106}, {&quot;mols2grid-id&quot;: 107, &quot;data-SMILES&quot;: &quot;NCCS(=O)(=O)CCO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 38251012, &quot;data-mols2grid-id-display&quot;: 107}, {&quot;mols2grid-id&quot;: 108, &quot;data-SMILES&quot;: &quot;NS(=O)(=O)NC[C@@H]1CCCNC1&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 19503746, &quot;data-mols2grid-id-display&quot;: 108}, {&quot;mols2grid-id&quot;: 109, &quot;data-SMILES&quot;: &quot;NC(=O)NC(CO)(CO)CO&quot;, &quot;data-img&quot;: null, &quot;data-Name&quot;: 1283225, &quot;data-mols2grid-id-display&quot;: 109}]);\n",
       "\n",
       "\n",
       "// filter\n",
       "if (window.parent.mols2grid_lists === undefined) {\n",
       "    window.parent.mols2grid_lists = {};\n",
       "}\n",
       "window.parent.mols2grid_lists[&quot;default&quot;] = listObj;\n",
       "\n",
       "\n",
       "// selection\n",
       "class MolStorage extends Map {\n",
       "    multi_set(_id, _smiles) {\n",
       "        for (let i = 0; i &lt; _id.length; i++) {\n",
       "            this.set(_id[i], _smiles[i])\n",
       "        }\n",
       "    }\n",
       "    multi_del(_id) {\n",
       "        for (let i = 0; i &lt; _id.length; i++) {\n",
       "            this.delete(_id[i])\n",
       "        }\n",
       "    }\n",
       "    to_dict() {\n",
       "        var content = &#x27;{&#x27;\n",
       "        for (let [key, value] of this) {\n",
       "            content += key + &#x27;:&#x27; + JSON.stringify(value) + &#x27;,&#x27;\n",
       "        }\n",
       "        content = content.length &gt; 1 ? content.slice(0, -1) : content\n",
       "        content += &#x27;}&#x27;\n",
       "        return content\n",
       "    }\n",
       "    to_keys() {\n",
       "        var content = []\n",
       "        for (let [key] of this) {\n",
       "            content.push(key)\n",
       "        }\n",
       "        return content\n",
       "    }\n",
       "    download_smi(fileName, allItems) {\n",
       "        var content = &#x27;&#x27;\n",
       "\n",
       "        if (allItems) {\n",
       "            // Gather all smiles\n",
       "            for (var item of allItems) {\n",
       "                var smiles = item.values()[&#x27;data-SMILES&#x27;]\n",
       "                var id = item.values()[&#x27;mols2grid-id&#x27;]\n",
       "                content += smiles + &#x27; &#x27; + id + &#x27;\\n&#x27;\n",
       "            }\n",
       "        } else {\n",
       "            // Gather selected smiles\n",
       "            for (let [key, value] of this) {\n",
       "                content += value + &#x27; &#x27; + key + &#x27;\\n&#x27;\n",
       "            }\n",
       "        }\n",
       "\n",
       "        var a = document.createElement(&#x27;a&#x27;)\n",
       "        var file = new Blob([content], { type: &#x27;text/plain&#x27; })\n",
       "        a.href = URL.createObjectURL(file)\n",
       "        a.download = fileName\n",
       "        a.click()\n",
       "        a.remove()\n",
       "    }\n",
       "}\n",
       "var SELECTION = new MolStorage();\n",
       "\n",
       "\n",
       "\n",
       "// kernel\n",
       "function add_selection(grid_id, _id, smiles) {\n",
       "    SELECTION.multi_set(_id, smiles);\n",
       "    let model = window.parent[&quot;_MOLS2GRID_&quot; + grid_id];\n",
       "    if (model) {\n",
       "        model.set(&quot;selection&quot;, SELECTION.to_dict());\n",
       "        model.save_changes();\n",
       "    }\n",
       "}\n",
       "function del_selection(grid_id, _id) {\n",
       "    SELECTION.multi_del(_id);\n",
       "    let model = window.parent[&quot;_MOLS2GRID_&quot; + grid_id];\n",
       "    if (model) {\n",
       "        model.set(&quot;selection&quot;, SELECTION.to_dict());\n",
       "        model.save_changes();\n",
       "    }\n",
       "}\n",
       "if (window.parent.IPython !== undefined) {\n",
       "    // Jupyter notebook\n",
       "    var kernel_env = &quot;jupyter&quot;;\n",
       "} else if (window.parent.google !== undefined) {\n",
       "    // Google colab\n",
       "    var kernel_env = &quot;colab&quot;;\n",
       "} else {\n",
       "    var kernel_env = null;\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "// sort\n",
       "var sortField = &#x27;mols2grid-id&#x27;\n",
       "var sortOrder = &#x27;asc&#x27;\n",
       "\n",
       "// Sort dropdown\n",
       "$(&#x27;#mols2grid .m2g-sort select&#x27;).change(sort)\n",
       "\n",
       "// Sort order\n",
       "$(&#x27;#mols2grid .m2g-order&#x27;).click(flipSort)\n",
       "\n",
       "function sort(e) {\n",
       "    if (e) {\n",
       "        sortField = e.target.value\n",
       "        var selectedOption = e.target.options[e.target.selectedIndex]\n",
       "        var sortFieldDisplay = selectedOption.text\n",
       "    }\n",
       "\n",
       "    // Sort\n",
       "    if (sortField == &#x27;checkbox&#x27;) {\n",
       "        listObj.sort(&#x27;mols2grid-id&#x27;, {order: sortOrder, sortFunction: checkboxSort})\n",
       "    } else {\n",
       "        listObj.sort(sortField, {order: sortOrder, sortFunction: mols2gridSortFunction})\n",
       "    }\n",
       "\n",
       "    // Update UI.\n",
       "    $(this).parent().find(&#x27;.m2g-display&#x27;).text(sortFieldDisplay)\n",
       "}\n",
       "\n",
       "// prettier-ignore\n",
       "function flipSort() {\n",
       "    $(this).parent().removeClass(&#x27;m2d-arrow-&#x27; + sortOrder)\n",
       "    sortOrder = sortOrder === &#x27;desc&#x27; ? &#x27;asc&#x27; : &#x27;desc&#x27;\n",
       "    $(this).parent().addClass(&#x27;m2d-arrow-&#x27; + sortOrder)\n",
       "    sort()\n",
       "}\n",
       "\n",
       "function mols2gridSortFunction(itemA, itemB, options) {\n",
       "    var x = itemA.values()[options.valueName]\n",
       "    var y = itemB.values()[options.valueName]\n",
       "    if (typeof x === &#x27;number&#x27;) {\n",
       "        if (isFinite(x - y)) {\n",
       "            return x - y\n",
       "        } else {\n",
       "            return isFinite(x) ? -1 : 1\n",
       "        }\n",
       "    } else {\n",
       "        x = x ? x.toLowerCase() : x\n",
       "        y = y ? y.toLowerCase() : y\n",
       "        return x &lt; y ? -1 : x &gt; y ? 1 : 0\n",
       "    }\n",
       "}\n",
       "function checkboxSort(itemA, itemB, options) {\n",
       "    if (itemA.elm !== undefined) {\n",
       "        var checkedA = itemA.elm.querySelector(&#x27;input[type=checkbox]&#x27;).checked\n",
       "        if (itemB.elm !== undefined) {\n",
       "            var checkedB = itemB.elm.querySelector(&#x27;input[type=checkbox]&#x27;).checked\n",
       "            if (checkedA &amp;&amp; !checkedB) {\n",
       "                return -1\n",
       "            } else if (!checkedA &amp;&amp; checkedB) {\n",
       "                return 1\n",
       "            } else {\n",
       "                return 0\n",
       "            }\n",
       "        } else {\n",
       "            return -1\n",
       "        }\n",
       "    } else if (itemB.elm !== undefined) {\n",
       "        return 1\n",
       "    } else {\n",
       "        return 0\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "// grid interactions (select, click, tooltip, key events)\n",
       "// Check if selection UI is supported.\n",
       "var supportSelection = eval(&#x27;True&#x27;.toLowerCase());\n",
       "\n",
       "listObj.on(&quot;updated&quot;, initInteraction);\n",
       "\n",
       "// (Re)initialiuze all grid interaction every time the grid changes.\n",
       "function initInteraction(list) {\n",
       "    initCellClick()\n",
       "    initToolTip()\n",
       "    initKeyboard()\n",
       "    if (supportSelection) initCheckbox()\n",
       "\n",
       "\n",
       "    // Hide pagination if there is only one page.\n",
       "    if (listObj.matchingItems.length &lt;= listObj.page) {\n",
       "        $(&#x27;#mols2grid .m2g-pagination&#x27;).hide()\n",
       "    } else {\n",
       "        $(&#x27;#mols2grid .m2g-pagination&#x27;).show()\n",
       "    }\n",
       "\n",
       "    // Add a bunch of phantom cells.\n",
       "    // These are used as filler to make sure that\n",
       "    // no grid cells need to be resized when there&#x27;s\n",
       "    // not enough results to fill the row.\n",
       "    $(&#x27;#mols2grid .m2g-list&#x27;).append(&#x27;&lt;div class=&quot;m2g-cell m2g-phantom&quot;&gt;&lt;/div&gt;&#x27;.repeat(11));\n",
       "}\n",
       "\n",
       "// Cell click handler.\n",
       "function initCellClick() {\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;click&#x27;).click(function(e) {\n",
       "        if ($(e.target).hasClass(&#x27;m2g-info&#x27;) || $(e.target).is(&#x27;:checkbox&#x27;)) {\n",
       "            // Info button / Checkbox --&gt; do nothing.\n",
       "        } else if ($(e.target).is(&#x27;div&#x27;) &amp;&amp; $(e.target).hasClass(&#x27;data&#x27;)) {\n",
       "            // Data string --&gt; copy text.\n",
       "            copyOnClick(e.target)\n",
       "        } else if ($(e.target).hasClass(&#x27;m2g-callback&#x27;)) {\n",
       "            // Callback button.\n",
       "            onCallbackButtonClick(e.target)\n",
       "        } else {\n",
       "            // Outside checkbox --&gt; toggle the checkbox.\n",
       "            if (supportSelection) {\n",
       "                var chkbox = $(this).find(&#x27;input:checkbox&#x27;)[0]\n",
       "                chkbox.checked = !chkbox.checked\n",
       "                $(chkbox).trigger(&#x27;change&#x27;)\n",
       "            }\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Store an element&#x27;s text content in the clipboard.\n",
       "function copyOnClick(target) {\n",
       "    var text = $(target).text()\n",
       "    navigator.clipboard.writeText(text)\n",
       "\n",
       "    // Blink the cell to indicate that the text was copied.\n",
       "    $(target).addClass(&#x27;m2g-copy-blink&#x27;)\n",
       "    setTimeout(function() {\n",
       "        $(target).removeClass(&#x27;m2g-copy-blink&#x27;)\n",
       "    }, 450)\n",
       "}\n",
       "\n",
       "// Keyboard actions.\n",
       "function initKeyboard() {\n",
       "    // Disable scroll when pressing UP/DOWN arrows\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;keydown&#x27;).keydown(function(e) {\n",
       "        if (e.which == 38 || e.which == 40) {\n",
       "            e.preventDefault()\n",
       "        }\n",
       "    })\n",
       "\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).off(&#x27;keyup&#x27;).keyup(function(e) {\n",
       "        var chkbox = $(this).find(&#x27;input:checkbox&#x27;)[0]\n",
       "        if (e.which == 13) {\n",
       "            // ENTER: toggle\n",
       "            chkbox.checked = !chkbox.checked\n",
       "            $(chkbox).trigger(&#x27;change&#x27;)\n",
       "        } else if (e.which == 27 || e.which == 8) {\n",
       "            // ESC/BACKSPACE: unselect\n",
       "            chkbox.checked = false\n",
       "            $(chkbox).trigger(&#x27;change&#x27;)\n",
       "        } else if (e.which == 37) {\n",
       "            // LEFT\n",
       "            $(this).prev().focus()\n",
       "        } else if (e.which == 39) {\n",
       "            // RIGHT\n",
       "            $(this).next().focus()\n",
       "        } else if (e.which == 38 || e.which == 40) {\n",
       "            var containerWidth = $(this).parent().outerWidth()\n",
       "            var cellWidth = $(this).outerWidth() + parseInt($(this).css(&#x27;marginLeft&#x27;)) * 2\n",
       "            var columns = Math.round(containerWidth / cellWidth)\n",
       "            var index = $(this).index()\n",
       "            if (e.which == 38) {\n",
       "                // UP\n",
       "                var indexAbove = Math.max(index - columns, 0)\n",
       "                $(this).parent().children().eq(indexAbove).focus()\n",
       "            } else if (e.which == 40) {\n",
       "                // DOWN    \n",
       "                var total = $(this).parent().children().length\n",
       "                var indexBelow = Math.min(index + columns, total)\n",
       "                $(this).parent().children().eq(indexBelow).focus()\n",
       "            }\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Show tooltip when hovering the info icon.\n",
       "function initToolTip() {\n",
       "    $(&#x27;#mols2grid .m2g-info&#x27;).off(&#x27;mouseenter&#x27;).off(&#x27;mouseleave&#x27;).off(&#x27;click&#x27;).mouseenter(function() {\n",
       "        // Show on enter\n",
       "        $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;show&#x27;)\n",
       "        $(&#x27;body &gt; .popover&#x27;).click(function(e) {\n",
       "            if ($(e.target).hasClass(&#x27;copy-me&#x27;)) {\n",
       "                copyOnClick(e.target)\n",
       "            } else if ($(e.target).is(&#x27;button&#x27;)) {\n",
       "                \n",
       "            }\n",
       "        })\n",
       "    }).mouseleave(function() {\n",
       "        // Hide on leave, unless sticky.\n",
       "        if (!$(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;hide&#x27;)\n",
       "        }\n",
       "    }).click(function() {\n",
       "        // Toggle sticky on click.\n",
       "        $(this).closest(&#x27;.m2g-cell&#x27;).toggleClass(&#x27;m2g-keep-tooltip&#x27;)\n",
       "\n",
       "        // Hide tooltip when sticky was turned off.\n",
       "        if ($(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;show&#x27;)\n",
       "        } else if (!$(this).closest(&#x27;.m2g-cell&#x27;).hasClass(&#x27;m2g-keep-tooltip&#x27;)) {\n",
       "            $(this).closest(&#x27;.m2g-cell&#x27;).find(&#x27;.m2g-tooltip[data-toggle=&quot;popover&quot;]&#x27;).popover(&#x27;hide&#x27;)\n",
       "        }\n",
       "    })\n",
       "}\n",
       "\n",
       "// Update selection on checkbox click.\n",
       "function initCheckbox() {\n",
       "    $(&quot;input:checkbox&quot;).off(&#x27;change&#x27;).change(function() {\n",
       "        var _id = parseInt($(this).closest(&quot;.m2g-cell&quot;).attr(&quot;data-mols2grid-id&quot;));\n",
       "        if (this.checked) {\n",
       "            var _smiles = $($(this).closest(&quot;.m2g-cell&quot;).children(&quot;.data-SMILES&quot;)[0]).text();\n",
       "            add_selection(&quot;default&quot;, [_id], [_smiles]);\n",
       "        } else {\n",
       "            del_selection(&quot;default&quot;, [_id]);\n",
       "        }\n",
       "    });\n",
       "}\n",
       "\n",
       "// Callback button\n",
       "function onCallbackButtonClick(target) {\n",
       "    var data = {}\n",
       "    data[&quot;mols2grid-id&quot;] = parseInt($(target).closest(&quot;.m2g-cell&quot;)\n",
       "                                            .attr(&quot;data-mols2grid-id&quot;));\n",
       "    data[&quot;img&quot;] = $(target).parent().siblings(&quot;.data-img&quot;).eq(0).get(0).innerHTML;\n",
       "    $(target).parent().siblings(&quot;.data&quot;).not(&quot;.data-img&quot;).each(function() {\n",
       "        let name = this.className.split(&quot; &quot;)\n",
       "            .filter(cls =&gt; cls.startsWith(&quot;data-&quot;))[0]\n",
       "            .substring(5);\n",
       "        data[name] = this.innerHTML;\n",
       "    });\n",
       "\n",
       "    \n",
       "    // Call custom js callback.\n",
       "    None\n",
       "    \n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "/**\n",
       " * Actions\n",
       " */\n",
       "\n",
       "// Listen to action dropdown.\n",
       "$(&#x27;#mols2grid .m2g-actions select&#x27;).change(function(e) {\n",
       "    var val = e.target.value\n",
       "    switch(val) {\n",
       "        case &#x27;select-all&#x27;:\n",
       "            selectAll()\n",
       "            break\n",
       "        case &#x27;select-matching&#x27;:\n",
       "            selectMatching()\n",
       "            break\n",
       "        case &#x27;unselect-all&#x27;:\n",
       "            unselectAll()\n",
       "            break\n",
       "        case &#x27;invert&#x27;:\n",
       "            invertSelection()\n",
       "            break\n",
       "        case &#x27;copy&#x27;:\n",
       "            copy()\n",
       "            break\n",
       "        case &#x27;save-smiles&#x27;:\n",
       "            saveSmiles()\n",
       "            break\n",
       "        case &#x27;save-csv&#x27;:\n",
       "            saveCSV()\n",
       "            break\n",
       "    }\n",
       "    $(this).val(&#x27;&#x27;) // Reset dropdown\n",
       "})\n",
       "\n",
       "// Check all.\n",
       "function selectAll(e) {\n",
       "    var _id = [];\n",
       "    var _smiles = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "    });\n",
       "    add_selection(&quot;default&quot;, _id, _smiles);\n",
       "};\n",
       "\n",
       "\n",
       "// Check matching.\n",
       "function selectMatching(e) {\n",
       "    var _id = [];\n",
       "    var _smiles = [];\n",
       "    listObj.matchingItems.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = true;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "    });\n",
       "    add_selection(&quot;default&quot;, _id, _smiles);\n",
       "};\n",
       "\n",
       "// Uncheck all.\n",
       "function unselectAll(e) {\n",
       "    var _id = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = false;\n",
       "        } else {\n",
       "            item.show()\n",
       "            item.elm.getElementsByTagName(&quot;input&quot;)[0].checked = false;\n",
       "            item.hide()\n",
       "        }\n",
       "        _id.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "    });\n",
       "    del_selection(&quot;default&quot;, _id);\n",
       "};\n",
       "\n",
       "// Invert selection.\n",
       "function invertSelection(e) {\n",
       "    var _id_add = [];\n",
       "    var _id_del = [];\n",
       "    var _smiles = [];\n",
       "    listObj.items.forEach(function (item) {\n",
       "        if (item.elm) {\n",
       "            var chkbox = item.elm.getElementsByTagName(&quot;input&quot;)[0]\n",
       "            chkbox.checked = !chkbox.checked;\n",
       "        } else {\n",
       "            item.show()\n",
       "            var chkbox = item.elm.getElementsByTagName(&quot;input&quot;)[0]\n",
       "            chkbox.checked = !chkbox.checked;\n",
       "            item.hide()\n",
       "        }\n",
       "        if (chkbox.checked) {\n",
       "            _id_add.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "            _smiles.push(item.values()[&quot;data-SMILES&quot;]);\n",
       "        } else {\n",
       "            _id_del.push(item.values()[&quot;mols2grid-id&quot;]);\n",
       "        }\n",
       "    });\n",
       "    del_selection(&quot;default&quot;, _id_del);\n",
       "    add_selection(&quot;default&quot;, _id_add, _smiles);\n",
       "};\n",
       "\n",
       "// Copy to clipboard.\n",
       "function copy(e) {\n",
       "    // navigator.clipboard.writeText(SELECTION.to_dict());\n",
       "    content = _renderCSV(&#x27;\\t&#x27;)\n",
       "    navigator.clipboard.writeText(content)\n",
       "};\n",
       "\n",
       "// Export smiles.\n",
       "function saveSmiles(e) {\n",
       "    var fileName = &quot;selection.smi&quot;\n",
       "    if (SELECTION.size) {\n",
       "        // Download selected smiles\n",
       "        SELECTION.download_smi(fileName);\n",
       "    } else {\n",
       "        // Download all smiles\n",
       "        SELECTION.download_smi(fileName, listObj.items);\n",
       "    }\n",
       "};\n",
       "\n",
       "// Export CSV.\n",
       "function saveCSV(e) {\n",
       "    content = _renderCSV(&#x27;;&#x27;)\n",
       "    var a = document.createElement(&quot;a&quot;);\n",
       "    var file = new Blob([content], {type: &quot;text/csv&quot;});\n",
       "    a.href = URL.createObjectURL(file);\n",
       "    a.download = &quot;selection.csv&quot;;\n",
       "    a.click();\n",
       "    a.remove();\n",
       "};\n",
       "\n",
       "// Render CSV for export of clipboard.\n",
       "function _renderCSV(sep) {\n",
       "    // Same order as subset + tooltip\n",
       "    var columns = Array.from(listObj.items[0].elm.querySelectorAll(&quot;div.data&quot;))\n",
       "        .map(elm =&gt; elm.classList[1])\n",
       "        .filter(name =&gt; name !== &quot;data-img&quot;);\n",
       "    // Remove &#x27;data-&#x27; and img\n",
       "    var header = columns.map(name =&gt; name.slice(5));\n",
       "    // CSV content\n",
       "    header = [&quot;index&quot;].concat(header).join(sep);\n",
       "    var content = header + &quot;\\n&quot;;\n",
       "    listObj.items.forEach(function (item) {\n",
       "        let data = item.values();\n",
       "        let index = data[&quot;mols2grid-id&quot;];\n",
       "        if (SELECTION.has(index) || SELECTION.size === 0) {\n",
       "            content += index;\n",
       "            columns.forEach((key) =&gt; {\n",
       "                content += sep + data[key];\n",
       "            })\n",
       "            content += &quot;\\n&quot;;\n",
       "        }\n",
       "    });\n",
       "    return content\n",
       "}\n",
       "\n",
       "\n",
       "// generate images for the currently displayed molecules\n",
       "var draw_opts = {&quot;width&quot;: 130, &quot;height&quot;: 90};\n",
       "var json_draw_opts = JSON.stringify(draw_opts);\n",
       "\n",
       "var smarts_matches = {};\n",
       "\n",
       "// Load RDKit\n",
       "window\n",
       ".initRDKitModule()\n",
       ".then(function(RDKit) {\n",
       "    console.log(&#x27;RDKit version: &#x27;, RDKit.version());\n",
       "    window.RDKit = RDKit;\n",
       "    window.RDKitModule = RDKit;\n",
       "\n",
       "    // Searchbar\n",
       "    function SmartsSearch(query, columns) {\n",
       "    var smiles_col = columns[0];\n",
       "    smarts_matches = {};\n",
       "    var query = $(&#x27;#mols2grid .m2g-searchbar&#x27;).val();\n",
       "    var qmol = RDKit.get_qmol(query);\n",
       "    if (qmol.is_valid()) {\n",
       "        listObj.items.forEach(function (item) {\n",
       "            var smiles = item.values()[smiles_col]\n",
       "            var mol = RDKit.get_mol(smiles, &#x27;{&quot;removeHs&quot;: false }&#x27;);\n",
       "            if (mol.is_valid()) {\n",
       "                var results = mol.get_substruct_matches(qmol);\n",
       "                if (results === &quot;\\{\\}&quot;) {\n",
       "                    item.found = false;\n",
       "                } else {\n",
       "                    item.found = true;\n",
       "                    \n",
       "                    results = JSON.parse(results);\n",
       "                    \n",
       "                    var highlights = {&quot;atoms&quot;: [], &quot;bonds&quot;: []};\n",
       "                    results.forEach(function (match) {\n",
       "                        highlights[&quot;atoms&quot;].push(...match.atoms)\n",
       "                        highlights[&quot;bonds&quot;].push(...match.bonds)\n",
       "                    });\n",
       "                    \n",
       "                    var index = item.values()[&quot;mols2grid-id&quot;];\n",
       "                    smarts_matches[index] = highlights;\n",
       "                    \n",
       "                }\n",
       "            } else {\n",
       "                item.found = false;\n",
       "            }\n",
       "            mol.delete();\n",
       "        });\n",
       "    }\n",
       "    qmol.delete();\n",
       "}\n",
       "var search_type = &quot;Text&quot;;\n",
       "// Temporary fix for regex characters being escaped by list.js\n",
       "// This extends String.replace to ignore the regex pattern used by list.js and returns\n",
       "// the string unmodified. Other calls should not be affected, unless they use the exact\n",
       "// same pattern and replacement value.\n",
       "// TODO: remove once the issue is fixed in list.js and released\n",
       "String.prototype.replace = (function(_super) {\n",
       "    return function() {\n",
       "        if (\n",
       "            (arguments[0].toString() === &#x27;/[-[\\\\]{}()*+?.,\\\\\\\\^$|#]/g&#x27;)\n",
       "            &amp;&amp; (arguments[1] === &#x27;\\\\$&amp;&#x27;)\n",
       "        ) {\n",
       "            if (this.length === 0) {\n",
       "                return &#x27;&#x27;\n",
       "            }\n",
       "            return this\n",
       "        }\n",
       "        return _super.apply(this, arguments);\n",
       "    };         \n",
       "})(String.prototype.replace);\n",
       "\n",
       "// Switch search type (Text or SMARTS)\n",
       "$(&#x27;#mols2grid .m2g-search-options .m2g-option&#x27;).click(function() {\n",
       "    search_type = $(this).text();\n",
       "    $(&#x27;#mols2grid .m2g-search-options .m2g-option.sel&#x27;).removeClass(&quot;sel&quot;);\n",
       "    $(this).addClass(&quot;sel&quot;);\n",
       "});\n",
       "\n",
       "// Searchbar update event handler\n",
       "$(&#x27;#mols2grid .m2g-searchbar&#x27;).on(&quot;keyup&quot;, function(e) {\n",
       "    var query = e.target.value;\n",
       "    if (search_type === &quot;Text&quot;) {\n",
       "        smarts_matches = {};\n",
       "        listObj.search(query, [&#x27;data-mols2grid-id&#x27;, &#x27;data-Name&#x27;]);\n",
       "    } else {\n",
       "        listObj.search(query, [&quot;data-SMILES&quot;], SmartsSearch);\n",
       "    }\n",
       "});\n",
       "\n",
       "    \n",
       "    // Generate images for the currently displayed molecules.\n",
       "RDKit.prefer_coordgen(true);\n",
       "function draw_mol(smiles, index, template_mol) {\n",
       "    var mol = RDKit.get_mol(smiles, &#x27;{&quot;removeHs&quot;: false }&#x27;);\n",
       "    var svg = &quot;&quot;;\n",
       "    if (mol.is_valid()) {\n",
       "        var highlights = smarts_matches[index];\n",
       "        if (highlights) {\n",
       "            var details = Object.assign({}, draw_opts, highlights);\n",
       "            details = JSON.stringify(details);\n",
       "            mol.generate_aligned_coords(template_mol, true);\n",
       "        } else {\n",
       "            var details = json_draw_opts;\n",
       "        }\n",
       "        svg = mol.get_svg_with_highlights(details);\n",
       "    }\n",
       "    mol.delete();\n",
       "    if (svg == &quot;&quot;) {\n",
       "        return &#x27;&lt;svg width=&quot;130&quot; height=&quot;90&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 130 90&quot;&gt;&lt;/svg&gt;&#x27;;\n",
       "    }\n",
       "    return svg;\n",
       "}\n",
       "\n",
       "// Update images when the list is updated.\n",
       "listObj.on(&quot;updated&quot;, function (list) {\n",
       "    var query = $(&#x27;#mols2grid .m2g-searchbar&#x27;).val();\n",
       "    var template_mol;\n",
       "    if (query === &quot;&quot;) {\n",
       "        smarts_matches = {};\n",
       "        template_mol = null;\n",
       "    } else {\n",
       "        template_mol = RDKit.get_qmol(query);\n",
       "        template_mol.set_new_coords(true);\n",
       "    }\n",
       "    $(&#x27;#mols2grid .m2g-cell&#x27;).each(function() {\n",
       "        var $t = $(this);\n",
       "        var smiles = $t.children(&quot;.data-SMILES&quot;).first().text();\n",
       "        var index = parseInt(this.getAttribute(&quot;data-mols2grid-id&quot;));\n",
       "        var svg = draw_mol(smiles, index, template_mol);\n",
       "        $t.children(&quot;.data-img&quot;).html(svg);\n",
       "    });\n",
       "    if (template_mol) {\n",
       "        template_mol.delete();\n",
       "    }\n",
       "});\n",
       "    \n",
       "\n",
       "    // Trigger update to activate tooltips, draw images, setup callbacks...\n",
       "    listObj.update();\n",
       "    \n",
       "    // Set iframe height to fit content.\n",
       "    fitIframe(window.frameElement);\n",
       "});\n",
       "        &lt;/script&gt;\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\n",
       "\">\n",
       "</iframe>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_csv(\"https://raw.githubusercontent.com/PatWalters/practical_cheminformatics_tutorials/main/data/smarts_test.smi\",sep=\" \",names=[\"SMILES\",\"Name\"])\n",
    "mols2grid.display(df,subset=[\"img\",\"Name\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8cc78859",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:41.192474Z",
     "start_time": "2025-05-05T16:56:41.191008Z"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6c151427-5170-4e0b-a2d1-f6f0021a28c7",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-05T16:56:41.198028Z",
     "start_time": "2025-05-05T16:56:41.196910Z"
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
